web analytics

3 Differences between counter and sentinel controlled loops

differences-between-counter-controlled-sentinel-controlled-loops

Counter controlled loops are where we know the number of loop executions beforehand. Unlike counter controlled loops, in sentinel controlled loops the number of loop executions in unknow at the beginning and depends on decisions made inside the loop.

Read more

What are the counter and sentinel controlled loops?

counter-controlled-sentinel-controlled-loops

Based on the nature of the control variable and the condition or limit, the loops can be of two general categories; counter controlled and sentinel controlled loops. Counter controlled loops are where we know the number of loop executions beforehand. Unlike counter controlled loops, in sentinel controlled loops the number of loop executions in unknow at the beginning and depends on decisions made inside the loop.

Read more