Fill the array A (20) with random integers from the range from 1 to 100. Find the maximum MAX of those elements of A

Fill the array A (20) with random integers from the range from 1 to 100. Find the maximum MAX of those elements of A that are less than the arithmetic mean C of all elements of A. Output A, C, MAX.

Program massiv;
const
n = 20;
var
a: array [1..n] of integer;
i, max, c: integer;
begin
max: = 0;
c: = 0;
randomize;
for i: = 1 to n do
begin
a [i]: = random (99) +1;
c: = c + a [i]; {To save memory, the sum of the elements is written into a cell, where the value of the arithmetic mean will later be located}
write (a [i], ”);
end;
writeln;
c: = c div n; {Find the arithmetic mean}
for i: = 1 to n do
if (a [i]> max) and (a [i] <c) then max: = a [i]; {Checking the array elements for compliance with the task condition}
write (c, ”, max);
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.