program penjmlhn_array;
uses crt;
var
x : array[1..100] of integer;
data : integer;
i : integer;
jmlh : integer;
begin
clrscr;
write('jmlh bnyk data= ');
readln(data);
jmlh:=0;
for i:=1 to data do
begin
write('data-',i,'= ');
readln(x[i]);
jmlh:=jmlh+x[i];
end;
writeln;
writeln('data siswa= ');
for i:=1 to data do
write(' ',x[i]);
writeln;
writeln('hasil penjumlhan data di atas= ',jmlh);
readln;
end.
Minggu, 15 Januari 2012
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar