Counters and Accumulators
We already seen and use the counters and the accumulators, on previous lessons. Counters are used to count something, are used to know how many an events or something occurs, and the accumulators are used to sum several values.
A classic example were you need a accumulator and a counter is calculate the average of several numbers. To do this you need to sum every number and at the end dive the total by the quantity of the numbers sum. See the code: