tempat BERJUANG
About Me
- arista WHIE
- hai.. welcome to my blog... namaku wiwik.. Asli BALI.. aku kuliah di ITS jurusan STATISTIKA.. NRP 1311100020.. silahkan menikmati blogku.. see it n' enjoy it... semoga bermanfaat... kalau ad kurang g usah sungkan kasi komentar ya..
Diberdayakan oleh Blogger.
Pengikut
Sabtu, 19 November 2011
program-program baru
program plus2;
uses wincrt;
var i,n:integer;
rata,vars,jml,jml1, sd, max, min, range:real;
x:array [1..100] of real;
begin
readln (n);
if n<0 then write ('tidak terdefinisi') else if n>0 then
begin
for i:=1 to n do
readln (x[i]);
begin
jml:=0;
for i:=1 to n do
jml:=jml+(x[i]);
rata:=jml/n;
writeln ('rata-rata= ',rata);
end;
begin
jml1:=0;
for i:=1 to n do
jml1:=jml1+((x[i]-rata)*(x[i]-rata));
vars:=jml1/(n-1);
writeln ('varian= ',vars);
end;
begin
sd:= sqrt (vars);
writeln ('standar deviasi= ',sd);
end;
begin
max:= (x[i]);
min:=(x[i]);
for i:=1 to n do
if (x[i]) > max then max:=(x[i])
else if (x[i]) < min then min :=(x[i]);
writeln ('nilai minimum= ',min);
writeln ('nilai maksimum= ',max);
range:= max-min;
writeln ('range= ',range);
end;
end;
end.
uses wincrt;
var i,n:integer;
rata,vars,jml,jml1, sd, max, min, range:real;
x:array [1..100] of real;
begin
readln (n);
if n<0 then write ('tidak terdefinisi') else if n>0 then
begin
for i:=1 to n do
readln (x[i]);
begin
jml:=0;
for i:=1 to n do
jml:=jml+(x[i]);
rata:=jml/n;
writeln ('rata-rata= ',rata);
end;
begin
jml1:=0;
for i:=1 to n do
jml1:=jml1+((x[i]-rata)*(x[i]-rata));
vars:=jml1/(n-1);
writeln ('varian= ',vars);
end;
begin
sd:= sqrt (vars);
writeln ('standar deviasi= ',sd);
end;
begin
max:= (x[i]);
min:=(x[i]);
for i:=1 to n do
if (x[i]) > max then max:=(x[i])
else if (x[i]) < min then min :=(x[i]);
writeln ('nilai minimum= ',min);
writeln ('nilai maksimum= ',max);
range:= max-min;
writeln ('range= ',range);
end;
end;
end.
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar