Given an array of integers, you need to find the arithmetic mean and find elements equal to 5.
program zz1;
const n = 12; // set the number of elements in the array
var i, k, s: integer; // set variables of integer type
m: array [1..n] of integer;
begin
for i: = 1 to n do // get n random numbers and write them into an array
m [i]: = random (6);
for i: = 1 to n do // display the resulting array on the screen
write (m [i], ”);
writeln; // go to a new line to display the response
for i: = 1 to n do // organize a loop in which we iterate over all the elements of the array
begin s: = s + m [i]; k: = k + 1; end; // get the sum and the number of elements
write (‘arithmetic mean of array elements =’, s / k: 5: 2); // display the answer
writeln; // go to a new line to display the response
for i: = 1 to n do // organize a loop in which we iterate over all the elements of the array
if m [i] = 5 then writeln (‘element number equal to five =’, i);
end.