Check Whether a Number is Even or Odd Using C Program
The following example shows, how to find given number is Odd or Even using C Program.
Example : pgm.c
#include<stdio.h> #include<math.h> int main(){ int n; printf("\nEnter Number : "); scanf("%d",&n); if(n%2==0){ printf("\nGiven Number is Even"); }else{ printf("\nGiven Number is Odd"); } return 0; }
Output:
Enter Number : 25
Given Number is Odd
Given Number is Odd