34,333
edits
Changes
no edit summary
== Combining case Statements ==
In the above example, each case had its own set of statements to execute. Something Sometimes a number of different matches will may require the same code to be executed. In this case, it is possible to group case statements together with a common set of statements to be executed when a match for any of the cases is found. For example, we can modify the switch construct in our example so that the same code is executed regardless of whether the user enters 0, 1 or 2:
<pre>