C++ Switch

C++ switch Control Statement

The switch control statement allows checking variable for equality against a list of values. The switchstatement checks an integer, char or enumerated type in its condition expression. It does not take any floating variable in its condition expression.

Syntax

C++ switch Example

Output