CONTOH ARRAY 1
Uses winCrt;
Const
nama : Array[1..4] of string=('Roni','galih','Roy','Fajar');
Var
i:integer;
Begin
For i:= 1 to 4 Do
Writeln('Nama penghuni kamar kost no ',i ,' = ',nama[i]);
End.
CONROH ARRAY 2
Program bilangan_ke_n;
Uses winCrt;
var
bil : Array[1..5] of integer;
i:integer;
Begin
clrscr;
For i:= 1 to 5 Do
begin
Write('bilangan ke ',i,' = ');readln(bil[i]);
end;
For i:= 1 to 5 Do
begin
write('---------------------------> ');
Writeln('nilai array ke- ',i,' nilainya = ',bil[i]);
end;
End.
Komentar