C program to find even or odd number.

C program to check even or odd using if else statement
/*C program to check even or odd using if else statement*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
printf("Enter an integer\n");
scanf("%d",&n);
if( n%2 == 0 )
printf("Entered number is even\n");
else
printf("Entered number is odd\n");
getch();
}
Expected Output:
Enter an integer
25
Entered number is odd

Post a Comment

Previous Post Next Post