Even or Odd number in C language

 WAP that finds whether a given number is even or odd.


#include <stdio.h>

#include<conio.h>

void main()

{

    int a;

    printf("Enter any number: ");

    scanf("%d", &a);

    if (a % 2 == 0)

        printf("The given number is EVEN");

    else 

        printf("The given number is ODD");

    getch();

}


Output

Enter any number: 10 

The given number is EVEN

Post a Comment

0 Comments