Important C Programs

C Program to Check Whether a Number is Even or Odd

//C Program to Check Whether a Number is Even or Odd
//Header Files
#include<stdio.h>
#include<conio.h>

void main()
{

int number;
clrscr();
printf("Enter an integer: ");
scanf("%d", &number);

// True if the number is perfectly divisible by 2
if(number % 2 == 0)
{

printf("%d is even.", number);

}
else
{

printf("%d is odd.", number);

}
getch();

}

Output


You can also see a video how to run this program