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.
- Calculate num % 2.
- Check if the result is exactly 0.
- Return the boolean result.
01EXAMPLE 1
Input
num = 13Output
falseExplanation: 13 % 2 is 1 (odd).
Constraints
- Use the % operator.
- Return a boolean result.
FundamentalsMathOperators
JavaScriptSystem handles I/O — write your function only
Loading...
9 Hidden
Input Arguments
num13
Expected Output
false
Click RUN to test your solution