Flow control

Martin McBride, 2017-02-03
Tags none
Categories none

The 3 elements of program flow are:

  • Sequence - executing a set of instructions in a fixed order.
  • Selection - executing certain instructions depending on certain logical tests. This is usually controlled using if statements or switch statements.
  • Iteration - looping over the same code multiple times. This is usually controlled by while loops (looping while ever a particular condition is true) or for loops (which loop a specific number of times).

These are covered in detail in the next few topics.

Copyright (c) Axlesoft Ltd 2021