Program cacah data
program cacah_data;
uses wincrt;
var
x:array[1..10] of integer;
i,n,jum,njum:integer;
rata:real;
begin
clrscr;
jum:=0;
write('Masukkan cacah data =');readln(n);
for i:= 1 to n do
begin
write('Masukkan data ke-',i, '=');readln(x[i]);
jum:=jum+x[i];
njum:=njum+1;
Rata:=jum/njum;
end;
writeln('Jumlah = ',jum);
writeln('Rata-rata = ',rata:0:2);
end.
makasihhhhh bantuannya
ya gan sama" makasih ya udah mampir ke blog saya..!