Iteration (Latin iteratio – repetition) – repetition activity (usually multiple) the same instruction (or multiple instructions) in a loop.
We use it when we do not know the exact number of repetitions, but we want the given instruction
to be executed at least once.
The instructions are executed as long as the given condition is false, and when it is fulfilled, the repetition ends.
write ('Enter a number (0 ends input) )');
if x<>0 then
The program calculates the sum of unknown number of numbers.
The summation ends when the number 0 is given.
write('Enter the final number ');
The program calculates the sum of integers 1+2+3+...+final_number.