Program Penambahan Indeks Dengan Pascal

Share On :



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

  • Mahasiswa STMIK Duta Bangsa
  • description
  • description
  • description
  • description
  • description
  • description
  • description

Free Hosting

Free Hosting

My Blog List

A
B
C
     
D
E
F
DuGMp3    
G
H
I
Goo Otomotif HouseofScript  
J
K
L
Java Hotline    
M
N
O

My Games Collection

MeLangKah LeBih MaJu

   
P
Q
R
Pamella Decoration    
S
T
U
Studied WaLL    
V
W
X
     
Y
Z
0-9
     









Join....!


Free Domain

Free Domain

SiNyO. Powered by Blogger.