Challenge 2

🔂

For Loops Simple

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

Write separate loops to output:

Tasks:

  1. all the denary digits from 1-1000
  2. from 5 to 10
  3. counting down from 10 to 0
  4. all the even numbers up to 100
  5. all the odd numbers up to 99
  6. the 7 times table, counting down from 700
  7. a variable step amount - e.g. 1, 2, 3 (if starting from 1, would output 1, 2, 4, 7, 11, 16, 22 etc)

Extension:

Output any additional numeric sequence - the first 100 square numbers, the first 100 powers of 2 etc

Solutions

IGCSE 0478 / O-Level 2210 A-Level 9618