Using flowcharts, write an algorithm to read 100 numbers and then display the sum.
Answers
Answered by
11
Answer:
Step 1: Start.
Step 2: Read n, sum, i.
Step 3: Initialize sum=0 and i=0.
Step 4: do (sum=sum+i; i=i+1) while (i<n)
Step 5 : Print sum
Step 6: end
Answered by
0
Write an algorithm to read 100 numbers and then display the sum.
- START
- PUBLICLY ANNOUNCE A VARIABLE NAMED COUNT
- ANNOUNCE ANOTHER VARIABLE TOTAL
- INITIALIZE ADD UP TO ZERO
- SUM TO ZERO AT THE OUTSET
- PERIOD, REPEAT UNTIL THE COUNT REACHES 100.
- ADD ONE MORE TO THE COUNT
- DIVIDE BY 2 FOR THE REST OF THE NUMBER
- SUM = SUM + COUNT MUST BE COMPLETED IF REMAINDER IS ZERO.
- END LOOP
- PRESENT THE USER WITH THE VARIABLE SUM'S VALUE
- END
#SPJ2
Similar questions