Friday, 24 January 2014

find whether the number is even or odd

#include <stdio.h>
int main() /*main function*/
{
int num,res;
printf("\n enter the number\n
");
scanf("%d",&num);
res=num%2;
if(res==0) /*if-else loop*/
{
printf("\n entered number is even");
}
else
{
printf("\n entered number is odd");
}
return 0;
}

No comments:

Post a Comment