var arr: array[1..12] of integer; i, j, temp: integer;
begin writeln('Enter 12 numbers: '); for i := 1 to 12 do readln(arr[i]);
// Sorting the array in ascending order for i := 1 to 12 do begin for j := i + 1 to 12 do begin if arr[i] > arr[j] then begin temp := arr[i]; arr[i] := arr[j]; arr[j] := temp; end; end; end;
// Displaying the numbers in ascending order writeln('Numbers in ascending order: '); for i := 1 to 12 do write(arr[i], ' '); end.
program SortArray;
var
arr: array[1..12] of integer;
i, j, temp: integer;
begin
writeln('Enter 12 numbers: ');
for i := 1 to 12 do
readln(arr[i]);
// Sorting the array in ascending order
for i := 1 to 12 do
begin
for j := i + 1 to 12 do
begin
if arr[i] > arr[j] then
begin
temp := arr[i];
arr[i] := arr[j];
arr[j] := temp;
end;
end;
end;
// Displaying the numbers in ascending order
writeln('Numbers in ascending order: ');
for i := 1 to 12 do
write(arr[i], ' ');
end.