Here , if i interchanged line 18 and 20 with each other the my result was 20 insteed of 15
Discuss about my result output
hello @parasjain7086
yeah becuase u are first incrementing i and then adding it to sum.
you should first add i to sum and then increment i
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.