Modulo Division

EasyAcc. 96.8%
+25 XP 8

Parity Check

Identifying even and odd numbers is a fundamental algorithmic task. The Modulo (%) operator provides the remainder of a division. For even numbers, the remainder when divided by 2 is always 0.

  1. Calculate num % 2.
  2. Check if the result is exactly 0.
  3. Return the boolean result.

01EXAMPLE 1

Inputnum = 13
Outputfalse

Explanation: 13 % 2 is 1 (odd).

Constraints

  • Use the % operator.
  • Return a boolean result.
FundamentalsMathOperators
JavaScript
Loading...
9 Hidden

Input Arguments

num13

Expected Output

false

Click RUN to test your solution