How to print average of 2d arrays? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to print average of 2d arrays?

For example i am trying to get the averge of each array and print it out like this: 8,8,8= Average: 8.0 9,9,9= Average: 9.0 By the way the arrays are already set I just need to get average of each array. There is only two rows.

8th Mar 2018, 6:41 AM
William Rodriguez
William Rodriguez - avatar
3 Answers
8th Mar 2018, 7:20 AM
Sad
Sad - avatar
+ 1
You can get average of each row and then find the average of all averages found.
8th Mar 2018, 7:08 AM
cHiRaG GhOsH
cHiRaG GhOsH - avatar
0
since it is a 2d array how wouod i do that?
8th Mar 2018, 7:10 AM
William Rodriguez
William Rodriguez - avatar