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

23rd Dec 2020, 6:57 AM
Sergei
1 ответ
+ 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!
23rd Dec 2020, 8:37 AM
Lothar
Lothar - avatar