HOW TO write algorithm

TO add the number 1 to 100 and display the sum

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)
```

To write an algorithm to add the numbers 1 to 100 and display the sum, you can follow these steps:

1. Start the algorithm.
2. Initialize a variable called "sum" to 0.
3. Set up a loop to iterate through the numbers from 1 to 100.
4. Inside the loop, add the current number to the "sum" variable.
5. Move to the next number.
6. Repeat steps 4 and 5 until all numbers from 1 to 100 have been processed.
7. Display the value of the "sum" variable.
8. End the algorithm.

Here is the algorithm in a more formalized way:

```
1. Start
2. Set sum = 0
3. Set i = 1
4. While i <= 100, do steps 5-7
5. Set sum = sum + i
6. Increment i by 1
7. End while
8. Display sum
9. End
```

You can convert this algorithm to the programming language of your choice to get the desired result.