Question 7
Back to Exercise
Which is true about default in a switch?
- A It must be last
- B It can be anywhere and runs only when no case matches Correct
- C It runs every time
- D Every switch must have one
Correct Answer: Option B
default is optional and may be placed anywhere. It is chosen only if no case matches – but if it has no break, control falls through into the cases written after it.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!