An even number is an integer that is exactly divisible by 2. Example: 0, 8, -24 An odd number is an integer that is not exactly divisible by 2. Example: 1, 7, -11, 15
#include
#include
void main()
{
int n;
clrscr();
printf(“enter any number: ”);
scanf(“%d”,&n);
if(n%2==0)
printf(“number is even”);
else
printf(“number is odd”);
getch();
}
Output:
enter any no: 5
number is odd