Challenge 20

1️⃣2️⃣

Even or Odd

Open in Code Editor or Copy Instructions
...solutions at bottom of page...

Create a function which takes in a number as a parameter and returns whether it is even or odd

Examples:

isEven(100) returns true

isEven(1 + 2 + 3) returns true

isEven(1 + 2 + 3 + 4) returns false

Extension:

Output from 0 to 1000 and print whether each number is even or add

Solutions

IGCSE 0478 / O-Level 2210 A-Level 9618