PASCAL PERULANGAN

1). PERULANGAN FOR TO DO

PROGRAM PERULANGAN;
USES WINCRT;
VAR A:INTEGER;
BEGIN
FOR A:=1 TO 10 DO
WRITELN(‘BANGGA PRATAMA’);

END.

2) PERULANGAN WHILE DO

PROGRAM PERULANGAN_WHILE_DO;
USES WINCRT;
VAR A:INTEGER;
BEGIN
A:=1;
WHILE A<=10 DO
BEGIN
WRITELN('TUGAS PASCAL');
A:=A+1;
END;

END.

3). PERULANGAN FOR DOWNTO DO

PROGRAM PERULANGAN_FOR_DOWNTO_DO;
USES WINCRT;
VAR A:INTEGER;
BEGIN
FOR A:= 10 DOWNTO 1 DO
WRITELN(A);

END.

4). PERULANGAN FOR TO DO BERSARANG

PROGRAM PERULANGAN_FOR_TO_DO_BERSARANG;
USES WINCRT;
VAR A,B:INTEGER;
BEGIN
FOR A:= 1 TO 10 DO
FOR B:= 1 TO 5 DO

WRITELN(A,' ',B);

END.

5) WHILE DO BERSARANG

PROGRAM WHILE_DO_BERSARANG;
USES WINCRT;
VAR
A,B:INTEGER;
BEGIN
CLRSCR;
A:=1;
B:=1;
WHILE A<10 DO
BEGIN
A:=A+1;
WHILE B4;
A:=A+1;
UNTIL
A >2
END.

Tinggalkan Balasan

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 / Ubah )

Twitter picture

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

Facebook photo

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

Connecting to %s

Ikuti

Get every new post delivered to your Inbox.