Perhatikan potongan program berikut ini
var
capcay:array[1..10] of integer = (43,99,1,56,12,89,5,13,76,20);
i,bawang,kol:integer;
begin
bawang := 1;
while bawang <= 10 do
begin
kol := bawang;
for i := bawang to 10 do
if (capcay[i] < capcay[kol]) then kol := i;
if (bawang <> kol) then
begin
capcay[bawang] := capcay[kol] + capcay[bawang];
capcay[kol] := capcay[bawang] – capcay[kol];
capcay[bawang] := capcay[bawang] – capcay[kol];
end;
inc (bawang);
end;
for i := 1 to 10 do write(capcay[i],‘ ’);
end.
Apakah hasil output dari potongan kode diatas?