c-programming

C Program to find Odd or Even number

This program I am writing for school students and for fresher programmers who wish to learn C language by themselves.

To find if an entered number is Odd or Even, you need to know the basic mathematics. Any number which is divided exactly by 2 is an Even number.

For example 12 / 2 = 6 (quotient), and the remainder is 0 (zero); So basically if the remainder value is Zero (0) it is an Even number

In C you have two operators to get the quotient (/) and the remainder value (%). So in our case we have to use the modulus operator (%) to figure out whether the entered number is an Odd number or an Even number.

Let’s write the C program to Find Odd or Even Number:

Output of the above program will be:

 

Related Posts

Leave a Reply