C Program to Check Whether a Number Is Even or Odd


C program to check whether a number is even or odd using if..else statement

#include <stdio.h>

int main()
{
    int num;
    printf("Enter the number:\t");
    scanf("%d",&num);
    if(num%2 == 0){
        printf("%d is even number",num);
    }
    else{
        printf("%d is odd number",num);
    }
    return 0;
}
Above program shows how to check whether a number is even or odd.

Post a comment

Post a Comment (0)

Previous Post Next Post