Check The Programming Section
To check a given number is odd or even we can use the modulus operator (%) and check the reminder by dividing the number by 2. If the reminder of the divission operation between the number and 2 is 1 then the number is ODD and if the reminder is zero it is an even number. For example,
If a number is taken as 25 and then divide it by 2 then the reminder is 1. In C programming to get the reminder we can use modulus (%) operator and any of these two approaches we can follow: