What Is C++ Switch Case?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
C++ switch case is a control statement used to select one of many blocks of code to be executed. It is an alternative to the if…else statement. A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case. If there is a match, the code block associated with that case is executed. The switch statement is usually used with one or more of the relational operators, such as “==” (equal to) or “>=” (greater than or equal to).