Tuesday, August 14, 2012

How to Write a Program Which will tell you a number is Even or Odd


#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf(“\n\t\t\t\t\Enter Your Value”);
scanf(“%d”,&a);
b=a/2;
c=b%1;
if(c==0)
{
printf(“\t\t\tThis is Even Number”);
}
if(c!=0)
{
printf(“\t\t\tThis is Odd Number”);
}
getch();
}

No comments:

Post a Comment