24. C Program To Check A Number Is Even Number or Odd Number.
How does this program work?
- In This program you are going to learn about how to check a given number is even or odd using C language.
- The folowing code contains the logic to check number the given number is even or odd.
Here is the code
#include <stdio.h>
int main(void)
{
int number;
printf ("Enter a number \n");
scanf("%d", &number);
if (number%2==0)
printf("%d is a Even number \n", number);
else
printf("%d is a odd number \n", number);
return 0;
}