Print Odd or Even (Using if-else)

The program must accept an integer N as the input. The program must print Odd if N is odd. Else the program must print Even as the output.

Example Input/Output 1:
Input:
5

Output:
Odd

Example Input/Output 2:
Input:
18

Output:
Even

#include<stdio.h>
int main()
{
    int N;
    scanf("%d", &N);
    if(N % 2){
        printf("Odd");
    }
    else{
        printf("Even");
    }
    return 0;
}
Previous Article

Print the Larger of Two Numbers (Using if-else)

Next Article

Check If Two Integers are Equal (Using if-else)

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *