Table of Contents

Check even or odd number

Program to Check even or odd number in C language.
#include <conio.h>

#include <stdio.h>
int main()

{
int num;
printf("Enter an integer: ");
scanf("%d", &num);

if(num % 2 == 0)

{
printf("%d is even.", num);

}
else

{
printf("%d is odd.", num);

}

getch();

}
Output

         Enter the integer: 6

         6 is even