Program Menghitung_Ratarata_Menggunakan_Array;
Uses crt;
Var
A : array[1..5] of integer;
Rata : real;
N,jum,I : integer;
Begin
Writeln(‘Program Menghitung Rata-rata Menggunakan array’);
Writeln(‘----------------------------------------------‘);
Writeln(‘Created By AN’);
Writeln(‘---------------------------------‘);
Write(‘Data Yang Dimasukkan Maksimal 5: ‘);readln(n);
For i:= 1 to n do
Begin
Write(‘Data Ke-‘,I,’ ‘);readln(A[i]);
End;
Jum:=0
For i:= 1 to n do
Jum:=jum + A[i];
Rata:=jum/n;
Writeln(‘Jumlah Nilai: ‘,jum);
Writeln(‘Nilai Rata-rata: ‘,rata);
Readln;
End.