# Invert the array without using additional arrays.

January 17, 2021 | education

| program mirror;

const n = 20; // sets the number of array elements

var a: array [1..n] of integer;

temp: integer;

begin

randomize;

// Form the array

for i: integer: = 1 to n do

begin

a [i]: = random (n);

write (a [i]: 3);

end;

writeln ();

// Reverse the array

for i: integer: = 1 to trunc (n / 2) do

begin

temp: = a [i];

a [i]: = a [n + 1 – i];

a [n + 1 – i]: = temp;

end;

// Output the array

for i: integer: = 1 to n do write (a [i]: 3);

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.