C Program To Check Whether A Number Is Even Or Odd

In this example, We take integer input from user and check inputted number is even or odd.

C Program To Check Whether a Number is Even or Odd :

in this example we use simple logic to find odd or even number.If a number is exactly divisible by 2 then its an even number else it is an odd number.

Example :

#include <stdio.h>
int main()
    int num;
    printf("Enter an integer number: ");
        printf("%d is an EVEN number.",num);
        printf("%d is an ODD number.",num);
    return 0;

Output :

		//Output :- 1
		Enter an integer number: 160
		160 is an EVEN number.
		//Output :- 2
		Enter an integer number: 155
		155 is an ODD number.

Share your thoughts

Ask anything about this examples