Skip to content

Iteration: FOR

FOR counts

  • A count-controlled loop runs once for each integer from the start to the end, inclusive.
  • The counter is an INTEGER.
  • It is good practice to repeat the counter's name after NEXT.

FOR I ← 1 TO 5 runs five passes; I takes 1 to 5 and Total grows 1, 3, 6, 10, 15, so the output is 15

Handout

Log in or create account

IGCSE, A-Level & AP