Call us at 0700-922-6559 or Click here

Write a program to find whether the given number is even or odd

#include <stdio.h>

int main() {

    int num;

    printf(“Enter an integer: “);

    scanf(“%d”, &num);

    // true if num is perfectly divisible by 2

    if(num % 2 == 0)

        printf(“%d is even.”, num);


        printf(“%d is odd.”, num);    

    return 0;



Enter an integer: 40

40 is even.

Leave a Reply

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