Programming

C – Check Whether the Entered Number is Even or Odd

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

C Code

#include <stdio.h>
#include <conio.h>
void main()
{
int number;

printf("enter number : n");
scanf("%d",&number);

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

getch();
}

Output

Tuts

About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.