Turbo pascal | Sololearn: Learn to code for FREE!

0

Turbo pascal

Turbo pascal Given a linear array of n-elements Determine the mean among the positive elements of an array

12/23/2020 6:57:54 AM

Sergei

1 Answer

New Answer

+2

Sergei , use a loop to iterate over the array, and use a conditional expression to build the sum of only positive values, as well as to count the number of positive values. Than divide the sum by the number of positive elements. Happy coding!