Looping

1: Program Tutorial3_for;
2: var i: Integer;
3: Begin
4:   For i:=1 to 5 do
5:     writeln('ini yang ke ', i);
6: End.

 1: Program Tutorial3_while;
 2: var i: Integer;
 3: Begin
 4:   i:=1;
 5:   while i < 5 do
 6:   begin
 7:     writeln('ini yang ke ', i);
 8:     i:=i+1;
 9:   end;
10: End.

1: Program Tutorial3_repeat;
2: var pilih: char;
3: Begin
4:   i:=1;
5:   repeat
6:     writeln('ini yang ke ',i);
7:     i:=i+1;
8:   until i<0;
9: End.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s