To check a given number is odd or even


Levels of difficulty: / perform operation:

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

Program

  
#include <stdio.h>
#include <conio.h>
void main()
{
	int a;
	clrscr();
	printf("\nENTER A NUMBER: ");
	scanf("%d",&a);
	if(a%2==0)
		printf("\nTHE NUMBER IS AN EVEN NUMBER");
	else
		printf("\nTHE NUMBER IS AN ODD NUMBER");
	getch();
}


Output







Quantitative Aptitude
Reasoning
Programming
Interview