Looking for answers? Westonci.ca is your go-to Q&A platform, offering quick, trustworthy responses from a community of experts. Ask your questions and receive detailed answers from professionals with extensive experience in various fields. Join our platform to connect with experts ready to provide precise answers to your questions in different areas.

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

We hope our answers were useful. Return anytime for more information and answers to any other questions you have. Thank you for visiting. Our goal is to provide the most accurate answers for all your informational needs. Come back soon. Westonci.ca is here to provide the answers you seek. Return often for more expert solutions.