Check for Even or Odd Program In C Programming

Check for Even or Odd Program In C Programming

#include <stdio.h>

int main() {

    int num;

    printf("Enter Number: ");

    scanf("%d", &num);

    /* logic */

    if (num % 2 == 0) {

        printf("The given number is EVEN\n");

    } else {

        printf("The given number is ODD\n");

    }

    return 0;

}

Output :
Even - Odd output



You might also like this :

Leave a Reply

Make sure you tick the "Notify Me" box below the comment form to be notified of follow up comments and replies.