Controls#
Control statements in C++ are used to control the flow of execution of a program. They are used to alter the sequence in which statements are executed based on certain conditions. There are three types of control statements in C++:
- Condition Statements#
perform different actions based on a condition. In C++, conditional statements include if, if-else, and switch statements
- Iterative Statements#
used to execute a set of statements repeatedly until a condition is met. In C++, looping statements include for, while, and do-while statements
- Jump Statements#
transfer control of a program to a different part of the program. In C++, jump statements include break, continue, and goto statements.
Using these control statements, C++ programmers can create complex programs that can perform different actions based on certain conditions and can execute the same set of statements repeatedly until a condition is met.