Saturday, March 12, 2016

Program to check whether entered number is odd or even.

#include<stdio.h>
int main()
{
 int number;

 printf("Enter number:");
 scanf("%d",&number);

 if(number%2 == 0)
  printf("Entered number is even.");
 else
  printf("Entered number is odd.");
 return 0;
}
/* Sample Output
Enter number:5
Entered number is odd.
*/

No comments:

Post a Comment