Control statements determine the flow of execution of a C++ program.
C++ control statements are broadly divided into:
Selection Statements
Iteration Statements
Jump Statements
Used to make decisions based on conditions.
Used to repeat a block of code.
Used to transfer control.
| Statement | Description |
|---|---|
break | Terminates a loop or switch |
continue | Skips current iteration |
goto | Transfers control unconditionally |
return | Exits from a function |
Example:
Control statements manage program flow
Selection statements make decisions
Iteration statements repeat tasks
Jump statements alter execution flow
Control statements are essential in C++ for implementing logic, conditions, and repetitive tasks in programs.
Take quizzes related to this topic and see where you stand!
Start Quiz Now