You are given an array B, which contains 10 elements of an integer type. Find: A) the sum of the elements
July 31, 2021 | education
| You are given an array B, which contains 10 elements of an integer type. Find: A) the sum of the elements of this array B) the product of the elements of this array C) The arithmetic mean of this array Pascal algorithm is needed For example: Program Summa; Var B: array (1..10) of integer; etc.
Program summa;
var
sum, pr, k, i: integer;
A: array [1..10] of integer;
begin
sum: = 0;
pr: = 1;
k: = 0;
for i: = 1 to 10 do
begin
sum: = sum + A [i];
pr: = pr * A [i];
k: = k + 1;
end;
writeln (‘sum of members =’, sum, ‘; product =’, pr, ‘; arithmetic mean =’, pr / k);
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.