Skip to main content

Design a Flowchart to Calculate & Print Sum of N numbers

Description

The flowchart outlines a program that calculates the sum of numbers from 1 to a given input (N). It begins by declaring three variables: N, SUM, and COUNT. The program then takes user input for N and initializes SUM and COUNT. A loop iterates as long as COUNT is less than or equal to N, adding COUNT to the SUM and incrementing COUNT. Finally, it displays the sum (SUM) and concludes the program.

Flowchart

What does this mean ?

  • START → The Start symbol marks the beginning of the program.
  • VARIABLE DECLARATION → This step introduces and names three variables: N, SUM, and COUNT, used to store input, sum of numbers, and the current number to be added.
  • USER INPUT PROMPT → This step involves prompting the user to input the value of N, which is then stored in the variable N.
  • INITIALIZE SUM → The program sets the initial value of SUM to 0.
  • INITIALIZE COUNT → The program sets the initial value of COUNT to 1.
  • CONDITION CHECK → This step checks if COUNT is less than or equal to N, determining whether the loop should continue or not.
  • UPDATE SUM → When the condition is true, this step updates the value of SUM by adding COUNT to it.
  • UPDATE COUNT → Following SUM update, this step increments COUNT by 1 for the next iteration.
  • DISPLAY OUTPUT → The program displays the calculated sum (SUM) to the user.
  • END → The End symbol marks the conclusion of the program's execution.

Learn more

Reference