C Program to Check Whether a given Number is Even or Odd

Write a C program to check whether a given number is even or odd.

C program to check even or odd

/* Aim: To Find whether the number is even or odd */

#include<stdio.h>
int main()
{
	int a;
 
	printf("\n Enter Your number:");
	scanf("%d",&a);

	if (a%2==0)
		printf("\n %d is even number \n \n",a);
	else
		printf("\n %d is odd number \n \n",a);
	return 0;
}

Output:

 Enter Your number:2

 2 is even number