Search & Find out

Saturday, November 21, 2009

even or odd

#include "stdio.h"
#include "conio.h"
 

   void main()
{

int num;
clrscr();
printf("Enter the a number: \t");
scanf("%d",&num);

if(num==0)
{
  printf("The number is Zero\n");
}
else if((num%2)==0)
{
printf("The number is even");
}
else
{
printf("The number is odd");
}

getch();
}



Download the executable (.exe)  file for this program..
download

0 comments:

Post a Comment

 

My Blog List

Term of Use