Program description:

In this program, at first we will ask the user to enter a number and then check weather the number is odd or even. In this program we will use the concept of if and else. We will divide the number by 2, if the remainder is 0 then it is an even number and if 1,then it is a odd number.

Source code:

#include<stdio.h>
int main()
{
int n; printf("Enter a number:");
scanf("%d",&n);
if(n%2==0)
printf("%d is an even number",n);
else
printf("%d is a odd number",n);
} 

Output: