Write a program that displays the 2 minimum array elements and their numbers.

program zz1;
const n = 4; // set the number of elements in the array
var i, min1, min2, k: integer; // set variables of integer type
m: array [1..n] of integer;
begin
for i: = 1 to n do // write numbers in the array at random
m [i]: = random (21);
for i: = 1 to n do // display the array on the screen
write (m [i], ”);
writeln; // go to a new line to display the response
min1: = 100000;
for i: = 1 to n do // find the maximum element and its number
if m [i] <min1 then begin min1: = m [i]; k: = i; end;
writeln (‘first minimum item =’, min1); // display the answer
writeln (‘its serial number =’, k);
min2: = 100000;
for i: = 1 to n do // find the maximum element and its number
if (m [i] <= min2) and (m [i]> min1) then begin min2: = m [i]; k: = i; end;
writeln (‘second minimum item =’, min2); // display the answer
write (‘its sequence number =’, k);
end.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.