## Definition

In computer science, a loop is a programming structure that repeats a sequence of instructions until a specific condition is met. Programmers use loops to cycle through values, add sums of numbers, repeat functions, and many other things.

Loops are supported by all modern programming languages, though their implementations and syntax may differ. Two of the most common types of loops are the while loop and the for loop.

The for-loop:

FOR I = 1 TO N
-- do some stuff
NEXT I

The while-loop:

WHILE (boolean condition) THEN
-- do some stuff
LOOP