The C program to check given number is odd or even takes one integer number value as input from the user, and check the given number using '%' operator and displayed the output on the console/terminal using pritf() function.
#include<stdio.h>
int main(){
int n;
print("Enter the number : ");
scanf("%d", &n);
// if n is coompletely divisible by 2 then prints even otherwise n is odd
if(n % 2 == 0){
print("Even");
}else{
print("Odd");
}
return 0;
}
Comments
Oops!