Question
how to write pseudocode add the number from 1 to 100 and display the sum
Answers
1. Initialize a variable called "sum" to 0
2. Create a loop that will iterate from 1 to 100
3. Within the loop, add the current number to the "sum" variable
4. After the loop is finished, display the value of the "sum" variable
Pseudocode:
sum = 0
for i = 1 to 100
sum = sum + i
end for
display sum
2. Create a loop that will iterate from 1 to 100
3. Within the loop, add the current number to the "sum" variable
4. After the loop is finished, display the value of the "sum" variable
Pseudocode:
sum = 0
for i = 1 to 100
sum = sum + i
end for
display sum
Related Questions
Write a pseudocode and algorithm that to else the user to input 10 numbers in program we display the...
HOW TO WRITE pseudocode
TO add the number 1 to 100 and display the sum
HOW TO write algorithm and pseudocode
TO add the number 1 to 100 and display the sum
how to write algorithm and pseudocode and how to draw flowchart add the number from 1 to 100 and dis...