programSequences of instructions for a computer. 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:
sequenceIn computer programming, this is a set of instructions that follow on one from another.
selectionA decision within a computer program when the program decides to move on based on the results of an event.
iterationThe repetition of a block of statements within a computer program.
Sequence is the order in which instructionA single action that can be performed by a computer processor. occur and are processed. Selection determines which path a program takes when it is running. Iteration is the repeated executeCarry out an instruction. 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.