c program to find the number even or odd
C Program to find whether the given number is even or odd.
PROGRAM :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#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); else printf(" The number %d is Odd",num); return(0); } |
Sample Output:(using GNU GCC Compiler with Code Blocks IDE)
Enter a number to find Even or Odd: 5
The number 5 is Odd