Write a C program to check whether the given number is odd or even using if,if else
#include <stdio.h>
int main()
{
int number;
/* Input number from user */
printf("Enter any number: ");
scanf("%d", &number);
if(number%2==0)
{
printf("The number is even.");
}
else
{
printf("The number is odd.");
}
getchar();
getchar();
return 0;
}
Comments
Leave a comment