- 1

Can somebody help me write a c++ program that accepts 10 numbers in an array,and also finds the average of the ten numbers

Pls I need help

22nd Jun 2019, 10:10 PM
Saleh
4 Answers
+ 8
Saleh we can only help you if you have started up something otherwise no. Here on SL we don't do assignments or projects for users without them showing us a work done by them. https://code.sololearn.com/WU0L031ezdyo/?ref=app https://www.sololearn.com/discuss/1316935/?ref=app
22nd Jun 2019, 11:01 PM
Jella
Jella - avatar
+ 6
Inside the for loop, the second sum variable has been misspelled. Change it to sum from sim. Also, the keywords are case sensitive. Change For to for (lowercase f).
23rd Jun 2019, 4:19 AM
Shamima Yasmin
Shamima Yasmin - avatar
+ 4
// Fixed a couple typos... #include <iostream> using namespace std; int main() { double values [10] = {10,20,30,40,50,60,70,80,90,11}; double sum = 0; for ( int i = 0; i < 10; i++ ) { sum = sum + values [i]; } cout << sum/10<<endl; return 0; }
23rd Jun 2019, 11:41 PM
John Wells
John Wells - avatar
+ 1
#include <iostream> using namespace std; int main() { double values [10] = {10,20,30,40,50,60,70,80,90,11}; double sum = 0; For ( int i = 0; i < 10; i++ ) { sum = sim + values [i]; } cout << sum/10<<endl; return 0; } Hey is my code but its not working
23rd Jun 2019, 12:08 AM
Saleh