A loop in a computer program is an instruction that repeats until a specified condition is reached. In a loop structure, the loop asks a question. If the answer requires an action, it is executed. The same question is asked again and again until no further action is required. Each time the question is asked is called an iteration.
A computer programmer who needs to use the same lines of code many times in a program can use a loop to save time.
A goto statement can create a loop by jumping backward to a label, although this is generally discouraged as a bad programming practice. For some complex code, it allows a jump to a common exit point that simplifies the code.
A statement that alters the execution of a loop from its designated sequence is a loop control statement.
C#, for example, provides two loop control statements.