Thursday, 23 July 2015

C Program - To check the given number is EVEN or ODD

C program to check that the given number is EVEN or ODD



#include<stdio.h>
#include<conio.h>
void main()
{
int a;
clrscr();
printf("\nEnter the value for a :- ");
scanf("%d",&a);
if(a%2==0)
{
printf("\nThe given value is EVEN");
}
else
{
printf("\nThe given value is ODD");
}
getch();
}

Output :-


Enter the value for a :- 10

The given value is EVEN


Back to 'C Language Programs'

No comments:

Post a Comment