Even / Odd Number
/* C Program For Checking whether a number is even or odd */ #include< stdio.h> #include< conio.h> void main() { int a; clrscr(); printf("Enter A number : "); scanf("%d",&a); if(a%2 != 0) { printf("\nThe Number %d Is Odd",a); } else if(a%2 == 0) { printf("\nThe Number %d Is Even",a); } getch(); } /******************* OUTPUT ******************** Enter A number : 66 The Number 66 Is Even Enter A number : 37 The Number 37 Is Odd */
EmoticonEmoticon