HOW TO write algorithm

TO add the number 1 to 100 and display the sum

1 answer

1. Declare a variable named "sum" and initialize it to 0.
2. Use a for-loop to iterate through the numbers from 1 to 100.
3. Add each number to the "sum" variable inside the for-loop.
4. After the for-loop is completed, display the "sum" variable.

Algorithm:

```
sum = 0
for i in range(1,101):
sum += i
print(sum)
```