For loop pascal

In this article let’s discuss about For do loop pascal. Let’s go through the following methods without any delay 🙂

For do loop enables us to execute a sequence of statements multiple time in iterative fashion.

Method 1:

program for_loop;

var
    i : Integer;
    max : Integer;

begin
  Write('Type a number :');ReadLn(max);
  for i := 1 to max do
    WriteLn(i)
end.
Output:
Type a number : 5 
1
2
3
4
5

Hope the above methods works for you. Happy Learning and get back to us Anytime.

Realted Posts : Scala get file from url as string