program Tambah_Isi_indeks;
uses wincrt;
const NilaiMaksimum = 1000;
type Larik = array [1..NilaiMaksimum] of integer;
var
L : Larik;
batas : integer;
procedure Masukan(var L : Larik; n : integer);
var
i : integer;
begin
for i := 1 to n do
begin
write('Masukkan Nilai Ke-',i,' : '); readln(L[i]);
end;
end;
procedure Tambah (var L : Larik; n : integer);
var
i : integer;
begin
for i := 1 to (n-0) do
L[i] := L[i]+1;
end;
procedure Keluaran(var L : Larik; n : integer);
var
i : integer;
begin
for i := 1 to n do
write(L[i]:5);
end;
begin
writeln ('==================') ;
write ('Jumlah elemen : '); readln(batas);
write ('==================') ;
writeln;
Masukan(L,batas);
writeln;
Tambah(L,batas);
writeln;
writeln ('============================') ;
writeln ('Hasil Penambahannya Adalah : ');
writeln ('============================') ;
Keluaran(L,batas);
end.
Ini dia hasilnya setelah di run :
0 komentar:
Post a Comment