Tag: incrementing counter

Incrementing Counter

This is a programming statement which increases by a known amount, each time it is called.

  • Score=Score+1
  • One=One+1
  • Bonus=Bonus+10

Incrementing counters are often used inside loops to keep track of the number of iterations.

counter

In the example above the tries=tries+1 line is keeping track of how many times the loop has been iterated.