C Program to check even or odd
This is a simple c program to check whether an entered number is even or odd using different methods like using modulus operator, conditional operator etc.
Even number: Number is completely divided by 2
C example of check even or odd using modulus operator
#include <stdio.h> #include <conio.h> void main() { int n; printf("Enter an integer\n"); scanf("%d",&n); if ( n%2 == 0 ) printf("Entered number is Even\n"); else printf("Entered number is Odd\n"); getch();
Download C program to check even
Output of program

In this example, modulus operator is used to finding the remainder and after that check it's zero if its zero then the number is even otherwise odd.