C program that finds whether a given number is Even or Odd.

 Program :

#include<stdio.h>
#include<conio.h>
void main()
{ int n,r;
clrscr();
printf("Enter a number :\n");
scanf("%d",&n);
r=n%2;
if(r==0)
{
printf("The number is EVEN");
}
       else
       {
printf("The number is ODD");
       }
       getch();
}

Output :



Comments