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
3 Answers
+ 3
You're not calling your function.
cout << "The average of all elements is "
<< arrAvg2(); // note the ()
+ 2
Gerne âșïž
+ 1
And there it is.
Danke sehr