Home of web learners
www.webn3rd.com
Switch is used to execute code when your value and the value in the condition matched.
Lets look an example:
output:
your input value is two
here,you see that your input variable data try to match with value in case,if the value in case matched with your variable data,then the line after case is going to execute and when break found after executing,then it come out from switch
If any value not matched with case with your input data,then default case works
webn3rd.com