Simple Flow Control

So far the instructions written in our programs are executed one line at a time in the order in which they were entered from the beginning to the end.

However, we often need to have the program carry out different instructions and executes different parts of a program depending on certain conditions.

We can control the flow of the program better using a few branching mechanisms in C++ (if-else, switch, and the conditional expression).