Write a program to print the entered number is even or odd.

#include<stdio.h>

#include<conio.h>

int main()

{

clrscr();

int n;

printf(“Welcome to www.candcpp.com\n”);

printf(“Enter a number: \n”);

scanf(“%d”,&n);

if(n%2==0)

{

printf(“The number is even.\n”);

}

if(n%2==1)

{

printf(“The number is odd.\n”);

}

getch();

return 0;

}

 

Output Will Be:

Welcome to www.candcpp.com

Enter a number:

6

The number is even.

and if you entered the odd number the out will be:

Welcome to www.candcpp.com

Enter a number:

5

The number is Odd.