Thursday 12 July 2012

Print Even Or Odd in C


#include<stdio.h>
#include<conio.h>
void main()

{
int a;

    clrscr();

  printf("\n\nenter a number=");
  scanf("%d",&a);

  if(a%2==0)
    {
printf("\n\ngiven number is even");
  }

    if (a%2==1)
 {
printf("\ngiven number is ood");
}
getch();    
 }

No comments:

Post a Comment