+ 1
Whatâs wrong here?? Please help.
3 Answers
+ 1
Just add a 'Sum=0;' after the third loop inside to reset the value of Sum to 0 for next multiplication.
https://code.sololearn.com/c4GNgwQ4z13M/?ref=app
+ 1
So many thanks Eve. But i donât understand this. Initially I declare Sum =0 therefore the result would Come but itâs false or incorrect. Please explain the reason behind this. Thanks in advance â€ïžâ€ïž
0
Muhammad Rakib I think that is because on line 12 and line 13 (the inner for loop), the value of Sum changes. That is why I thought of resetting the value of Sum to 0 after that particular for loop that changes the value of Sum.