Question: Write a for loop that computes the following sum: 5 + 1 0 + 1 5 + 2 0 + + 4 8 5 +

Write a for loop that computes the following sum:5+10+15+20++485+490+495+500.The sum should be placed in a variable sum that has already been declared and initialized to 0.In addition, there is another variable, num that has also been declared.You must not use any other variables.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!