Introduction to Repetition in Programs

Get introduced to the concept of repetition and its advantages in programs.

In real-life, we often repeatedly perform specific tasks until we achieve a particular goal. For instance, while washing the dishes, we take a soiled dish, scrub it with a dishcloth and soap, rinse it with water, and place it in a rack. We keep doing this until all the dishes are done. Since we want our computers to mimic such behavior when solving problems, repetition is an integral tool in programming.

In computer programs, a sequence of instructions that executes until a condition becomes false is called a loop.

The format of a program with repetition

Take a look below to see the basic format of a program with repetition:

Get hands-on with 1200+ tech skills courses.