0
Why do we declare sum=0 in loops?
Loops
2 Antworten
+ 2
Hi there, your question is unclear. It also misses the tag to a language and a piece of code about your doubt
https://www.sololearn.com/discuss/1316935/?ref=app
Anyway you initialize sum with the value 0 because then you are gong to do sum = sum + something
And if your sum is not initialized, you are starting from a random amount.