Showing posts with label even or odd number. Show all posts
Showing posts with label even or odd number. Show all posts

Tuesday, November 22, 2011

Program in C to Find Even or Odd Number

It is a sample c program to find even or odd number.

Program Source Code


#include"stdio.h"
#include"conio.h"
void main()
{
int n ;
clrscr();
printf("\n ***Check 'even' ** or ** 'odd'**** ");
printf("\n Enter the number to check:-- ");
scanf("%d",&n);
if (n%2==0)
printf("\n Given no is even:--");
else
printf("\n Given no is odd:--");
getch();
}

Output


Even or Odd Number in C Program