USES WINCRT;
VAR
x:array[1..100] of real;
mean, rata,va: real;
n,j,i: integer;
BEGIN
write ('masukkan n banyaknya angka ');
readln (n);
for i :=1 to n do
begin
write ('n ke' ,i,' = ');
readln (x [i]);
end;
rata:=0;
for i:=1 to n do
rata:=rata + x [i] ;
mean:= rata/n;
writeln('mean=',mean :2:2);
va := 0 ;
for i:= 1 to n do
begin
va := va + ((sqr((x [i]) - mean)) / (n-1) );
end;
writeln ('varian=',va:2:3) ;
writeln ( 'standar deviasi=', sqrt (va):2:3) ;
end.
0 komentar:
Posting Komentar