0

Issue with Array Averaging Function

I must be missing something. I have a For and While function to average an array of integers (instead of just using Accumulate). However, the average keeps coming in as 1. Would someone please point out what I’m missing/doing wrong? https://code.sololearn.com/cp6krATSOGaD/?ref=app

17th Apr 2019, 5:23 PM
Joseph J. Fostano
Joseph J. Fostano - avatar
3 Answers
+ 3
You're not calling your function. cout << "The average of all elements is " << arrAvg2(); // note the ()
17th Apr 2019, 6:03 PM
Anna
Anna - avatar
+ 2
Gerne â˜ș
17th Apr 2019, 6:46 PM
Anna
Anna - avatar
+ 1
And there it is. Danke sehr
17th Apr 2019, 6:37 PM
Joseph J. Fostano
Joseph J. Fostano - avatar