# Given an array consisting of 10 integers, given randomly from the interval [5..25]

**Given an array consisting of 10 integers, given randomly from the interval [5..25], find the minimum and maximum values, their sum.**

program zz1;

const n = 10; // set the number of elements in the array

var i, max1, min: 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) +5;

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

max1: = 0;

for i: = 1 to n do // find the maximum element

if m [i]> max1 then max1: = m [i];

writeln (‘max element =’, max1); // display the answer

min: = 1,000,000; // set the initial value for the minimum element

for i: = 1 to n do // organize a loop in which we iterate over all the numbers in the array

if m [i] <min then min: = m [i]; // check if the number from the array is less than the minimum, then write it to the minimum

writeln (‘minimum element =’, min); // display the answer

writeln (‘the sum of the minimum and maximum elements =’, min + max1); // display the answer

end.