You are on page 1of 1

Deklarasi

bil: array[1..500] of integer;


n,i,jml,max,min :integer;
rata2: real;

Al goritma

max:=0;
min:=1000;
output('berapa jumlah bilangan : ');
input(n);
for i := 1 to n do

output ('bil ke- ',i,':');


input (bil[i]);
jml:= jml + bil[i];
rata2:=jml/n;

// bilangan maksimal
if bil[i] > max then
max:= bil[i]
else
max:= max;

//bilangan minimal
if bil[i] < min then
min:= bil[i]
else
min:=min;

output();
output ('bil terbesar : ', max);
output ('bil terkecil :', min);
output('total : ', jml);
output ('rata-rata :', rata2:2:2);