#include <stdio.h>intmain()
{
int number;
printf("Enter an integer: ");
scanf("%d", &number);
// True if the number is perfectly divisible by 2if(number %2==0)
printf("%d is even.", number);
else
printf("%d is odd.", number);
return0;
}
Write a program to accept an integer and check if it is even or odd.
Reviewed by
on
August 30, 2019
Rating: 5