Loops provide the facility to execute a block of code repetitively, based on a condition. This block of code is executed repeatedly till the time a specified condition remains true. This condition is checked based on loop's control variable.
The following flowchart prints the numbers 1 to 5. Here every time the condition (Count < 5) is true, "Print count" gets executed. So, we do not have to write the "Print" statement multiple times. Every loop must have an exit condition. In our example the exit condition is (Count > 5). The loop will exit when the condition is false.
