C Program to check if number is even or odd.
Answers
Answered by
13
Program code:
#include<stdio.h>
int main()
{
int num;
printf("Enter an integer: ");
scanf("%d",&num);
if ( num%2 == 0 )
printf("%d is an even number", num);
else printf("%d is an odd number", num);
return 0;
}
Output:
Enter an integer: 66
66 is even number
Enter an integer: 3
3 is an odd number
✌✌
Similar questions
English,
2 months ago
Math,
5 months ago
Science,
5 months ago
English,
11 months ago
Psychology,
11 months ago