Control flow - Wikipedia#Loop

Loop

🖼️ ➺

A loop is a sequence of statements, loop body, which is executed a number of times based on runtime state. The body is executed once for each item of a collection (definite iteration), until a condition is met (indefinite iteration), or infinitely. A loop inside the loop body is called a nested loop.123 Early exit from a loop may be supported via a break statement.45

In a functional programming language, such as Haskell and Scheme, both recursive and iterative processes are expressed with tail recursive procedures instead of looping constructs that are syntactic.

Printed 2026-06-28.

(echo:: @ )

Footnotes

  1. “Nested Loops in C with Examples”. GeeksforGeeks. 2019-11-25. Retrieved 2024-03-14.

  2. “Python Nested Loops”. www.w3schools.com. Retrieved 2024-03-14.

  3. Dean, Jenna (2019-11-22). “Nested Loops”. The Startup. Retrieved 2024-03-14.

  4. Knuth, Donald E. (1974). “Structured Programming with go to Statements”. Computing Surveys. 6 (4): 261–301. CiteSeerX 10.1.1.103.6084. doi:10.1145/356635.356640. S2CID 207630080.

  5. Roberts, E. [1995] “Loop Exits and Structured Programming: Reopening the Debate Archived 2014-07-25 at the Wayback Machine,” ACM SIGCSE Bulletin, (27)1: 268–272.