--

Program Pascal Menghitung Mean

Friday, January 22, 2010 mencoba sebuah karya dunia maya
Program Pascal Menghitung nilai rata-rata (Mean).
Berikut Source codenya:

uses crt;
var
x: array [1..100] of integer;
n,i,sum:integer;
mean: real;
begin
write('n:');readln(n);
sum:=0;
for i := 1 to n do
begin
write('x',i,'=');readln(x[i]);
sum:=sum+x[i];
end;
mean:= sum/n;
writeln('mean=',mean);
readln;

end.

0 komentar: Program Pascal Menghitung Mean

Post a Comment