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 case.
These statements are a substitute for long if statements that compare a variable to several integral values.
Read this article to understand switch case in C++ in depth
Have a doubt or thought? Join the discussion now
This is a companion discussion topic for the original entry at http://iq.opengenus.org/switch-case-cpp/