Skip to content

Loops: while, for, and accumulation

Handout

Repeating work

  • A loop runs the same block of code many times, so you don't copy it by hand.
  • C has three loops: while, for, and do-while. They all repeat while a condition is true.
  • The condition is checked each time around. When it becomes false, the loop stops.

Handout

Log in or create account

IGCSE & A-Level