Even or odd in c programming.

 #include<stdio.h>

#include<conio.h>

int main()
{int num;
Printf("enter the number");

scanf("%d",&num);

if(num % 2==0)
printf("number is even=%d",num);
else
printf("number is odd=%d",num);
return 0;
}

Output:enter the number 7

number is odd=7  enter the number 8

number is even=8

Comments

Post a Comment

Popular posts from this blog

Reverse table in c programming.

Simple interests in c programming