Question: In Assignment 2, you must create a for-loop that sums up numbers from 1 through (including) 100. Once you have the sum, divide by 100

In Assignment 2, you must create a for-loop that sums up numbers from 1 through (including) 100. Once you have the sum, divide by 100 to get the average of those numbers. Then repeat this idea from 1 through 1,000,000 (1 million). The base code fife has been given. Good luck! # 1. - # Set up variables for later myAvg = 0 mySum - 0 # 2. # Calculate sum of 1 through 100 # 3. - # Divide to get the average of numbers 1 through 100 # Calculate sum of 1 through 1,000,000 # 5. # Divide to get the Average of numbers 1 through 1,000,000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
