Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
For loops are control structures used for repetitive execution of code blocks. They consist of an initialization statement, condition statement, increment/decrement statement, and loop body. The loop continues until the condition becomes false.
Related terms
While Loop: A while loop is another type of control structure that repeatedly executes a block of code as long as a given condition is true.
Nested Loop: A nested loop is a loop inside another loop. It allows for more complex iterations and can be used to traverse multi-dimensional data structures.
Break Statement: The break statement is used within loops to terminate their execution prematurely based on certain conditions.