Iteration (Latin iteratio – repetition) – repetition activity (usually multiple) the same instruction (or multiple instructions) in a loop.

  LOOP „repeat”

   repeat instructions; until condition;

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.

  sum:=0; n:=0;
    write ('Enter a number (0 ends input) )');
    readln (x);
    if x<>0 then
   sum:=sum+x; n:=n+1;
  Until x=0;
  writeln('Mean =',mean:0:3);

The program calculates the sum of unknown number of numbers.
The summation ends when the number 0 is given.

  write('Enter the final number ');
  until num=0;

The program calculates the sum of integers 1+2+3+...+final_number.