Program code
#include <stdio.h>
#include <conio.h>
void main()
{
int a;
clrscr();
printf("Please input a number to find whether it is odd or even.\n");
scanf("%d",&a);
if ((a%2)==0)
printf("%d is even.\n",a);
else
printf("%d is odd.\n",a);
getch();
}
Example of output
Please input a number to find whether it is odd or even.
700
700 is even.
No comments:
Post a Comment