Program Array

Program urut;
uses wincrt;
var n,i:integer;
mean,simp,jum:real;
dat:array[1..100] of integer;
begin
write('masukkan n: ');
readln(n);
for i:=1 to n do
readln (dat[i]);
for i:=1 to n do
mean:= mean+dat[i];
mean:=mean/n;
writeln;
writeln (mean:0:2);
for i:=1 to n do
jum:=jum+sqr(dat[i]-mean);
simp:=jum/(n-1);
write(simp);
end.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 komentar:

Posting Komentar