Loops

The loop serves to repeat a certain activity. In programming, it is necessary to define what is to be repeated and how long. Remember that the number of repetitions must final because the endless program will never be beneficial. The loop consists of the loop body, i. e. the activity that is to be repeated, and the condition, i. e. how long the loop body is to be repeated.

Types of loops:

1. A loop with a fixed number of repeats - For-loop

2. A loop terminated by the condition

A. A loop with condition at the beginning - While loop

B. A loop with condition at the end- Repeat loop

Vytvorte si webové stránky zdarma! Táto stránka bola vytvorená pomocou služby Webnode. Vytvorte si vlastný web zdarma ešte dnes! Vytvoriť stránky