Quiz on C++ Switch Statement



1. What does the switch statement do in C++?
2. Which keyword is used to define a case in a switch statement?
3. What will happen if no break statement is used in a case?
4. What is the purpose of the default case in a switch statement?
5. Which of the following data types can be used in a switch statement?

Advertisements