what is the purpose of default clause in switch statement?
Answers
Answered by
8
When using switch case we use default case in the end because if the value u have entered do not match with the value in initial expression the the default case runs.
Answered by
2
The switch and case keywords evaluate expression and execute any statement associated with constant-expression whose value matches the initial expression. If there is no match with a constant expression, the statement associated with the default keyword is executed.
Similar questions