Q. What is the purpose of the ‘default’ clause in a switch statement?

A
To set a default variable value
B
To execute code if no case matches
C
To exit the switch
D
To define a new case
Solution:

The default clause executes when no case matches the switch expression.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!