Check If a Number is Odd Or Even In PHP & JavaScript

Odd numbers and even numbers are used in programming languages. To check if a number is even or odd needs brilliant code. In this post, you will be introduced to checkNum() function in both PHP and JavaScript. This functions will return even for even numbers and odd for odd numbers. Parameters $num – An integer (PHP) num – An integer (JS) Returns “odd” for odd number, “even” for even number.