Explore Westonci.ca, the top Q&A platform where your questions are answered by professionals and enthusiasts alike. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

Your classmate is frustrated because the code that was designed to add up her five quiz grades is not working properly.

What change would you suggest to your classmate based on this code?for (i=1;i<=5;i++){ sum=0sum=sum+i;}

Sagot :

srlt2

Answer:

sum = 0 must be before for loop. If inside for loop, it will keep resetting sum to 0 each iteration.

Explanation:

hope this helps