/*Program to check weather the number is odd or even*/
#include <stdio.h>
int main ()
{
int a;
printf("Enter the number:");
scanf("%d", &a);
if (a%2==0)
{
printf("the number is even");
}
else
{
printf("the number is odd");
}
return 0;
}
OUTPUT:
Enter the number:4
the number is odd
DESCRIPTION:
First of all we ask the user to input the number which should be checked and is divided by 2 and the final result is displayed.
No comments:
Post a Comment
If you have any doubt, please ask in the comment section.