Computer Science, asked by khushigarg27, 1 year ago

what is the purpose of default clause in switch statement?

Answers

Answered by rockyak4745
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 arjun7774
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