What is the significance of default clause in switch case statement?
Answers
Answered by
1
The switch and case keywords evaluate expression and execute anystatement associated with constant-expression whose value matches the initial expression. If there is no match with a constant expression, thestatement associated with the defaultkeyword is executed.
Answered by
2
Answer: default clause in switch statement works as the same as else clause in if else block. To simplify my statement, when no cases in the switch clause matches with the proper condition, then default clause is executed.
Similar questions