The idea is that our switch
statement evaluates an expression, in this case num
and accordingly runs code under the appropriate case
statement.
The switch
statement is very similar to an if
, but based on the input it tiggers a certain case. We want the case
3 here.