Print the average of the five numbers flowchart
Print the average of the five numbers flowchart
Question
Write a flowgorithm program that will take 5 numbers from the user using a loop and print the average of the five numbers
Answer

Create/Declare variables: Follow the instructions to create variables in the flowchart.
- num
- i
- sum
- average
num: to store the user input number.
i : i variable is the loop counter. To track how many times the for loop should run. You need to run the loop five times to take five numbers.
sum: The sum variable is used to accumulate the sum of the five numbers.
average: to store the average of the numbers.
Add a For loop symbol to the flowchart.
Inside the loop take the user input number using the Input shape.
Accumulate the sum of the number.
sum = sum + num
The value of the variable “sum” is fetched and the user input number “num” is added. The result is stored in the sum variable.
After the for loop, compute the average.
average = sum / 5
The value of sum / 5 is stored in the average variable.
Display the average using the Output symbol.
Sample Output
Test the flowchart so that it displays the correct output.
The sample output is shown below:

That’s it. Save the flowchart.