Welcome to our blog Contact Us Subscribe!

Check Odd Or Even Number In C Programming

Here's a full code to check if an integer is even or odd in C.

Check Odd Or Even Number In C Programming

Check Odd Or Even Number In C Programming

Here's a full code to check if an integer is even or odd in C:


#include <stdio.h>

int main() {
    int num;
    printf("Enter an integer: ");
    scanf("%d", &num);

    if (num % 2 == 0)
        printf("%d is even\n", num);
    else
        printf("%d is odd\n", num);

    return 0;
}

About the Author

Hi! I am Sailesh Rijal, A Fronted Web Developer at AliveCoder. If you ask me for my short introduction then I would love to tell my self as a noob web designer who wants to learn and grow everyday.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.