algorithm to print the sum of first N numbers using iteration
Answers
Answered by
0
n = 10
total = 0
for x in range(n + 1):
total += x
print(f"sum: {total}")
Answered by
0
Answer:
The answer is:
Explanation:
⦿Start
⦿Declare and initialize variable, i,num, s=0.
⦿Enter the value of num i.e. number upto which sum is to be calculated
⦿Use Loop to add number. Any of while, do-while or for loop can be used.
⦿Print the sum
⦿Stop
Please mark me as brainliest.
Similar questions