The logic you used is incorrect.Here you defined sum of number as i+number where i = 0 , it is same as printing out the numbers. It should be sum of number =0 (before the start of the loop) and then in the loop sum of number = sum of number+number.
1 Like
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.