Flowchart: sum from 1 to n with a loop

Read an integer n, add i to a running total while i goes from 1 to n, then print the total.

Steps

  1. Start, then read an integer n.
  2. Set the total to 0 and i to 1.
  3. Decide whether i is at most n.
  4. If it is, add i to the total, raise i by 1 and go back to the decision.
  5. When i passes n, print the total and end.

Good to know

Drawing happens in this browser only. Your text is never sent to a server. Symbol rules differ a little between textbooks, so check them against your course before you hand in.

See the symbol rules

More examples