In C++ programming language, all statements are executed sequentially from the top to the bottom. However, you can change the order (flow) of statements. Control flow structures allow you to alter the flow of the statements. Thus, you can develop complex programs that depict real world situations. In C++, you can alter the flow of statements in the following ways:
- You can repeat a set of statements a specified number of times. For more information, see Loop Structure.
- You check if a condition is true or false. Based on the result, you can execute a statement or a set of statements. For more information, see Conditional Structure.