Array Calculations | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Array Calculations

can someone explain why the number output is as big as it is. THANKS AS ALWAYS! šŸ™„ https://code.sololearn.com/cwWMoSlV09Bi/?ref=app

14th Apr 2017, 5:04 PM
Seth T
Seth T - avatar
7 Antworten
+ 9
https://code.sololearn.com/c12ja7amjqiE/?ref=app Here it is^ Initialize sum=0;
14th Apr 2017, 5:09 PM
Pixie
Pixie - avatar
+ 8
You can fix it by putting the cout <<sum outside the loop as I have done the code edit
14th Apr 2017, 5:28 PM
Pixie
Pixie - avatar
+ 7
You happen to be my 100th post btw šŸ˜ƒ
14th Apr 2017, 5:12 PM
Pixie
Pixie - avatar
+ 2
yea i figured it out before hand im dumb. thanks tho pixie šŸ™„
14th Apr 2017, 5:09 PM
Seth T
Seth T - avatar
+ 1
and awesome šŸ˜‚ glad i could be youre 100th post bro/guh, gratz šŸ™„
14th Apr 2017, 5:27 PM
Seth T
Seth T - avatar
0
ahhh so the last number output is all of the elememts in the array added, the ones output before the last is adding number by number till it reaches the main sum?
14th Apr 2017, 5:25 PM
Seth T
Seth T - avatar
0
ohhhhhhhh awesome thank you for the explanation pixie šŸ˜
14th Apr 2017, 5:28 PM
Seth T
Seth T - avatar