Program PascalRepeatLoop;
Var
number:integer;
begin
number := 1;
//REPEAT-UNTIL Statement - Post Condition Repetition
Repeat
Write('Enter an integer number: ');
readln(number);
Until number = 0; //Run code above, until "number" is 0
Writeln();
Writeln('Program Ended');
End.
Program PascalWhileLoop;
Var
number:integer;
begin
number := 1;
//WHILE DO Statement - Pre Condition Repetition
While number <> 0 do //Run code below, while "number" is not 0
begin
Write('Enter an integer number: ');
readln(number);
end;
Writeln();
Writeln('Program Ended');
End.
program for_loop;
var
i : Integer;
max : Integer;
begin
Write('Type a number :');ReadLn(max);
for i := 1 to max do
WriteLn(i)
end.