0
What wrong with this program
It's output should be total sum of array elements but it is printing random long numbers https://code.sololearn.com/c2ZB6FBSqCHX/?ref=app
3 Answers
+ 6
Also, it is recommended to initialize <sum> variable by zero to avoid it from garbage value, being uninitialized.