Common Elements to Loops

Looping control structures are used to execute a block of code multiple times until a condition is met. It is extremely important that the condition is met at some point in the loop, or you get what is known as an endless loop - one that never stops without killing the program.

All loops have three basic parts:

  1. A looping variable to store the current position
  2. A condition against which to test the value of the looping variable
  3. An increment/decrement assignment for the looping variable