C++ Control Structure

 

Control Structure

The work of control structures is to give flow and logic to a program. There are three types of basic control structures in C++.

 

Sequence Structure

Sequence structure refers to the sequence in which program execute instructions one after another. 

 

Selection Structure

Selection structure refers to the execution of instruction according to the selected condition, which can be either true or false. There are two ways to implement selection structures. They are done either by if-else statements or by switch case statements. 

 

Loop Structure

Loop structure refers to the execution of an instruction in a loop until the condition gets false.