Write a program. Enter a one-dimensional array of integers. Calculate how many times the sum of the even numbers
Write a program. Enter a one-dimensional array of integers. Calculate how many times the sum of the even numbers in the array exceeds the arithmetic mean of all the numbers in the array?
program zvvz1;
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 // n numbers get random and write them into the array
m [i]: = random (51);
for i: = 1 to n do // display the array received on the screen
write (m [i], ”);
writeln; // go to output the answer to a new line
for i: = 1 to n do
s: = s + m [i]; // get the sum of all
for i: = 1 to n do
if m [i] mod 2 = 0 then k: = k + m [i]; // get even sum
write (‘the sum of even numbers in the array exceeds the arithmetic mean of all numbers in the array in’, (s / n) / k: 5: 2, ‘times’); // print the answer
end.