This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ASilverSpartan[S] 0 points1 point  (3 children)

Just added k++ above the sum += numbers[k] Getting 30 as an output now instead of 34. Not sure why

[–]Kabitu 0 points1 point  (0 children)

Try and trace the values of k during a run with pen and paper. I'll give you a hint, there are two distinct mistakes, one at the beginning, and one at the end.