17 Control structures

In a computer program, control flow refers to the order in which the statements are executed. In the programs we have seen until now there has been a simple flow of control – the statements have been executed in the order they have appeared, i.e. in sequence. Control structures are special statements that allow us to change the order of statements based on some condition. There are two types of control structure – control structures for selection, and control structures for repetition. Selection control structures allow us to specify whether some statements in the code will be executed or not, and repetition control structures allow us to decide how many times certain statements will be executed.

In this chapter we will ...

Get Financial Modelling and Asset Valuation with Excel now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.