C program to check Even Odd Number

Below is C program to check Even Odd Number .

Program:

/* Check a number is even or odd */

#include<stdio.h>
int main()
{
    int a;
    printf("Enter a number: ");
    scanf("%d",&a);
    if(a%2==0)
        printf("Even Number");
    else
        printf("Odd Number");
   return 0;
}

No comments:

Post a Comment