C Program to find whether the given number is even or odd.
#include <stdio.h>
void main()
 int num;

 printf("Enter a number to find Even or Odd: \n");
 scanf("%d",&num);  //taking input from user

 if (num%2==0) //checking whether the remainder is zero when divided by 2
  printf(" The number %d is Even",num);
  printf(" The number %d is Odd",num);

Sample Output:(using GNU GCC Compiler with Code Blocks IDE)
Enter a number to find Even or Odd: 5
The number 5 is Odd

Leave a Reply

Your email address will not be published.