Sum It Up problem

plz help me…can u send me code…

This is the code dry run it once you will get the logic:


Mark your Doubt as resolved and rate it
Thanks!