Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  selsort
Language: PASCAL
Code:
program selection_sort; (* Pascal 7.0 compilerı için *)
var n,j,x,mi,min: integer;
la: array [1..100] of integer;
begin
writeln('dizinin eleman sayısını girin:');
read(n);
write('dizinin elemanlarn arada bir boslukla ');
 writeln('aynı satrda girin:');
for j:=1 to n do read(la[j]);
for j:= 1 to n do begin
    min:=la[j]; mi:=j;
    for x:=j+1 to n do begin
        if la[x]<min then begin min:=la[x]; mi:=x; end;
    end;
la[mi]:=la[j];
la[j]:=min;
write(min:5);
end; readln(x);
end.
          
Comments: