Important Notice:

Summation of a Set of Numbers

Summation of a Set of Numbers

5 views 1 min read

Summation of a Set of Numbers (संख्याओं के समूह का योग ):-

Question:-

Write an algorithm and flowchart to find the sum of a set of numbers.

संख्याओं के एक समूह का योग ज्ञात करने के लिए Algorithm और Flowchart लिखिए।

Example / उदाहरण -

Suppose the numbers are:- 5, 10, 15, 20, 25

Then:

SUM = 5 + 10 + 15 + 20 + 25
SUM = 75

Algorithm / एल्गोरिथ्म :-

  1. Start.
  2. Input the number of values N.
  3. Set SUM = 0.
  4. Set i = 1.
  5. Input a number.
  6. Add the number to SUM.
  7. Increment i by 1.
  8. If i ≤ N, repeat Steps 5 to 7.
  9. Display SUM.
  10. Stop.

Logic -

SUM = SUM + NUMBER → Adds the current number to the total sum.
i = i + 1 → Increases the counter by 1.
i ≤ N → Checks whether more numbers are left to add.

Related Notes