Challenge 4

📈

Sum to 1 Million!

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

Create a program to sum the numbers from 1 to 1 million using a loop

Extension:

Also implement the "arithmetic sequence formula" in code to verify that your loop is calculating the correct answer

Adapt the program to sum the first 1000 square numbers

Solutions

IGCSE 0478 / O-Level 2210 A-Level 9618