A simple blog which contains all the c programs i've done. In increasing order of difficulty from the simplest to the toughest program:)
Friday, December 24, 2010
C Program to find if the number is an even or odd number
/* C Program to Print whether a number accepted from a user is an odd or an even
number */
#include <stdio.h>
#include <stdlib.h>
int main()
{
int number;
printf("Enter a number\n");
scanf("%d",&number);
if((number%2)==0)
{
printf("The number is Even\n");
}
else
{
printf("The number is Odd\n");
}
return 0;
}
No comments:
Post a Comment