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, 24 Desember 2011
program modus
program modus;
uses wincrt;
var i,n,j,a :integer;
jumlah:real;
hitung, x,modus: array [1..100] of real;
begin
readln (n);
for i:=1 to n do
readln (x[i]);
begin
for i:=1 to n do
for j:=i+1 to n do
if (x[i]>x[j]) then
begin
a:=x[i];
x[i]:=x[j];
x[j]:=a;
end;
jumlah:=0;
begin
for i:=1 to n-1 do
begin
for j:=1+i to n do
if x[i]=x[j] then hitung [i]:=hitung[i]+1 else if (hitung [i]>hitung[jumlah]) then
begin
jumlah:=hitung(x[i]);
modus:=(x[i]);
end;
end;
writeln ('modus= ',modus,'jumlah data= ',jumlah);
end;
end.
uses wincrt;
var i,n,j,a :integer;
jumlah:real;
hitung, x,modus: array [1..100] of real;
begin
readln (n);
for i:=1 to n do
readln (x[i]);
begin
for i:=1 to n do
for j:=i+1 to n do
if (x[i]>x[j]) then
begin
a:=x[i];
x[i]:=x[j];
x[j]:=a;
end;
jumlah:=0;
begin
for i:=1 to n-1 do
begin
for j:=1+i to n do
if x[i]=x[j] then hitung [i]:=hitung[i]+1 else if (hitung [i]>hitung[jumlah]) then
begin
jumlah:=hitung(x[i]);
modus:=(x[i]);
end;
end;
writeln ('modus= ',modus,'jumlah data= ',jumlah);
end;
end.
Langganan:
Posting Komentar (Atom)
1 komentar:
aku baru tau blog mu.. keren wik:D
nanti ajarin aku buat program" ya.. :D
Posting Komentar