C Program to Check Whether the Entered Number is Even or Odd

0
7
digitalample eye
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

even or odd number

LEAVE A REPLY

Please enter your comment!
Please enter your name here