C Program to check whether the number is even or odd.

What are Even or Odd numbers:

Even  Number: A number which is evenly divisible (i.e leaves no remainder) by 2 is called an even number.

Odd  Number: A number which is not evenly divisible by 2 is called an odd number.

The following is a C program to check whether a number is even or odd.

Expected Output:

1st run:

2nd run:

How it works

A number is even if it is evenly divisible by 2. To check for even number we simply use remainder operator %. If the number is even then remainder operator will return 0, otherwise, a non-zero value. For example:


Related Programs

Leave a Comment

%d bloggers like this: