Site icon

Flowchart to calculate total and average of array elements


In this flowchart, we will compute the total and average of the array elements. Total is the sum of all the elements in the array. Average is total divided by the number of elements in the array.

To read values into an array, follow the link:




      DECLARE total
      DECLARE index

      total = 0
      index = 1
      DO UNTIL index > 5
         total = total + marks(index)
         index = index + 1
      OUTPUT "Total Marks =" + total
      OUTPUT "Average :=" + (total / Lenght_of(marks))


We will take the marks array in this example. marks array holds 5 subject marks of the student Alice.In this flowchart we will compute the total marks and the average.

Inside the loop, we will accumulate the sum of the array elements:

total <- total + marks[index]



After the loop we will output the total marks and calculate the average.

Average <- total/length_of(marks)


RAPTOR Tutorials on this website can be found at:

For more information on RAPTOR, visit the official website at:

Exit mobile version