5
Views
1
Comments
Solved
Average - List integer
Application Type
Traditional Web

Hello Guys,


I want to take the average of whole numbers from a list, how can I do it?



Listofinteger.PNG

Rank: #95
Solution

Hello Felipe,

Hope you're doing well.

You just need to have a variable to store the sum of your entire values (you'll need a decimal variable to do the average).

In each iteration, you add the current value of the list to that variable, so by the end of the cycle you will have the sum of all values:



After that you just need to divide that result by the number of elements in the list:

Hope that this helps you!


Kind regards,

Rui Barradas