Multiple choice

Which of the following is a selection statement in C++?

  1. Break

  2. Goto

  3. Exit

  4. Switch

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

A selection statement allows the program to choose between different execution paths based on a condition. In C++, 'switch' is a selection statement that selects one of many code blocks to execute. 'break' is used within loops and switch to exit, 'goto' is an unconditional jump, and 'exit' is a library function that terminates the program.