Saturday, March 29, 2014

C program to Find out Odd and Even numbers

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter a Number\n");
scanf("%d",&a);
b=a%2;
if (b==0)
{
printf("Number is odd");
}
else
{
printf("Number is even");
}
getch();
}

No comments:

Post a Comment