Given a number and we have to check whether it is an EVEN number of an ODD number using PHP Code.
EVEN numbers are the numbers which are divisible by 2, like: 2, 4, 6, 8, 10, etc, and the ODD numbers are not divisible by 2, like: 3, 5,7, 9, 1 etc
Example:
Input: 12
Output: 12 is an EVEN number
12 is divisible by 2, it returns remainder 0
Input: 13
Output: 13 is an ODD number
13 is not divisible by 2, because it returns remainder 1
Program to check EVEN and ODD in PHP
Output
need an explanation for this answer? contact us directly to get an explanation for this answer