C Program to Check Number is Even or Odd

Here you will get C program to check given number is even or odd.

We will utilize following basic rationale in this program.

In the event that a number is distinguishable by 2, at that point it is even.

In the event that a number isn’t distinguishable by 2, at that point it is odd.

Program

#include<stdio.h>
 
int main()
{
	int n;
	printf("Enter any number:");
	scanf("%d",&n);
	
	if(n%2==0)
		printf("The number is even");
	else
		printf("The number is odd");
 
	return 0;		
}

Output

Enter any number:17
The number is odd

Leave a Comment

error: Alert: Content is protected!!