void main()
{
int n;
printf("Enter a number:");
scanf("%d", &n);
if(n%2==0)
printf("Even number");
else
printf("Odd number");
}
Explanation:-
A number is said to be even if it is divisible by 2. Here, the number is divided by 2 and remainder is checked, if it is 0, even number is printed else odd number is printed.
0 Comments