Programming fundamentals - OCRThe three basic programming constructs

Programs are designed using common building blocks, known as programming constructs. These programming constructs form the basis for all programs.

Part ofComputer ScienceComputational thinking, algorithms and programming

The three basic programming constructs

are designed using common building blocks. These building blocks, known as programming constructs, form the basis for all programs.

There are three basic building blocks to consider:

Sequence is the order in which occur and are processed. Selection determines which path a program takes when it is running. Iteration is the repeated of a section of code when a program is running.

There are two types of iteration:

  • count-controlled iteration
  • condition-controlled iteration

All programs use one or more of these constructs. The longer and more complex the program, the more these constructs will be used repeatedly.