Output the sum of 5 multiples from 1 to 1000, but produce the output as shown in the following form. (Submit both programs using for statements and programs using while statements.) However, the for statement is used only once in the program.)
<Output results>
The sum up to 5 is 5
The sum up to 10 is 15
The sum up to 15 is 30
The sum up to 20 is 50
The sum up to 25 is 75.
..............
..............
The sum up to 95 is 950
The sum up to 100 is 1050
................
................
The sum up to 1000 is ..........
python
Please, let's do this much.
count = 0
for i in range(5, 1001, 5):
count += ?
The sum up to print(str(?) + " is " + str(?) + "")
count = 0
i = ?
while i ? 1001:
i += ?
? ? += i
The sum up to print(str(?) + " is " + str(?) + "")
© 2024 OneMinuteCode. All rights reserved.