Search Your C Program

Wednesday, 25 January 2012

Program to Find Whether a Number is Even or Odd

#include<stdio.h>
#include<conio.h>
void main()
{
                 int n;
                 clrscr();
                 printf("\n Enter  a number : ");
                 scanf("%d",&n);
                 if(n%2==0)
                 printf("\n%d is even number",n);
                 else
                 printf("\n%d is odd number",n);
}

NOTE"= In "C" language "=="operator  is used for comparison  of two values.

No comments:

Post a Comment