If a given number is divisible by 2 with the
remainder 0 then the number is even number. If the number is not divisible by 2
then that number will be odd number.
This C Program checks if a given integer is odd or
even. The program can be successfully compiled and run on any system.
#include
<stdio.h>
int
main() {
int
ival, remainder;
printf("Enter
an integer : ");
scanf("%d",
&ival);
if
(remainder == 0)
printf("%d
is an even integer\n", ival);
else
printf("%d
is an odd integer\n", ival);
}