WAP to Check Whether a Number is Odd or Even using C

 Here is the C program to check whether a number is odd or even — simple and clear.



#include <stdio.h>

int main() 

{

    int num;

    printf("Enter a number: ");

    scanf("%d", &num);

     if (num % 2 == 0) {

        printf("the number is even");

    } else {

        printf("the number is odd");

    }

      return 0;

}


Previous Post Next Post

Contact Form