engineering computer science MCQ #2173

How does `switch` statement work?

engineering computer science MCQ #2173

  1. Question 1

    Q1. How does `switch` statement work?

    • A) Checks all cases until a match is found
    • B) Jumps to the matching case
    • C) Executes all cases
    • D) Always executes default case

    Answer: Jumps to the matching case

    Explanation: switch jumps to the case matching the expression's value, then executes until break.