Monday, June 13, 2016

C program to check whether entered number is odd or even.

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

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

if(number%2 == 0)
printf("Entered number is even.");
else
printf("Entered number is odd.");
}

Output

Enter number:10
Entered number is even.

No comments:

Post a Comment