Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

What's the best way to calculate the average for the columns in a 2D-array and return it to a 1D-array.

OpenStudy (anonymous):

Something like this in c: for(col = 0; col < Number of Columns; col++) { for row = 0; row < Number of Rows; row++) { testSum += scores[row][col]; } testAvg = testSum / Number of Rows (which is the number who took the test). //do something with this testAvg. totalAvg = testAvg; //makes a running average. testAvg = testSum = 0; //reset for the next test average. }

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!