C Programming

C Program to 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

Related Articles

Back to top button

Adblock Detected

Please turn off your Adblocker to view your content.