Program ini di Run pake Dev_Pas...
Tampilan awal:
Setelah Di enter Bilangan yg diiput telah tersusun secara bubble sort Ascending..
Langsung ajah bos ini code nya:
-----------------------------------------------------------------------------Program Bubblesort_ascending;
uses crt;
const
maks = 50;
type
Larik = array[1..maks] of integer;
var
n,i,j : integer;
L: larik;
min : integer;
temp : integer;
{=======================INPUT LARIK===============================}
begin
writeln('Masukkan Jumlah data : '); readln(n);
for i:= 1 to n do
begin
writeln('Masukkan data ke-',i,' : ');read(L[i]);
end;
writeln('==================');
writeln('Data input nya adalah : ');
for i:=1 to n do
write(L[i],' ');
{============PROSES SORTING Bubble SORT ASCENDING===================}
for i:=1 to n-1 do
begin
for j:= n downto i+1 do
begin
if L[j] > L[j-1] then
begin
Temp:=L[j];
L[j]:=L[j-1];
L[j-1]:=temp;
end;
end;
end;
{===============TAMPIL DATA====================================}
writeln;
writeln('Data setelah Diurutkan dengan Bubble Sort Ascending : ');
for i := 1 to n do
write(L[i],' ');
readln;
readln;
end.
Thanks Bos.. Semoga Bermanfaat.. Alhamdulillah Jazakumuloh Khaira..
itu pakai windows brapa gan ?
ReplyDeletePake Aplikasi Dev-Pascal di Win 8
DeleteMakasih kembali..
ReplyDeleteterima kasih byak,sgt bermanfaat
ReplyDeleteterima kasih byak,sgt bermanfaat
ReplyDeletegan, gw konfirmasi aja program anda descending bkn ascending
ReplyDeletekarna, ascending : dari yg terkecil ke terbesar
descending itu goblok
ReplyDelete