Skip to content

Loops: while, for, and accumulation · ⁨循环:while、for 与累加⁩

English

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.
中文

重复做事

  • 循环让同一段代码运行很多次,这样你就不用手动复制它。
  • C 有三种循环:while、for、do-while。它们都在条件为真时重复。
  • 每一轮都会检查条件。当条件变为假时,循环就停止。

Handout

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩