Thursday, July 28, 2011

Display an integer is Even or Odd

#include<stdio.h>
void main()

{
int num;
clrscr();
printf("Enter a number : ");
scanf("%d",&num);
if((num%2)==1)
   printf("\n%d is an odd Number");
else
   printf("\n%d is an even Number");
getch();
}

0 comments:

Post a Comment