Monday, 4 September 2017

C-Program to print whether given number is Odd or Even



#include<stdio.h>

int main()
{
int i;
printf("Enter a Number to know whether it is even or odd\n");
scanf("%d",&i);
if(i%2==0)
{
printf("The number %d is Even",i);
}
else
{
printf("The number %d is Odd",i);
}
printf("\n");
return 0;
}
 Input : 5
Output : Odd

No comments:

Post a Comment