- A Error handling
- B A ternary operation
- C If statement
- D Switch statement
- Share this MCQ
Answer:
D
Share this MCQ
- A. Incorrect: Error handling is not a conditional statement.
- B. Incorrect: A ternary operation only checks if a value or expression is true. Based on the results, the operation takes different actions.
- C. Incorrect: The if statement does not allow multiple branches of code depending on a value. If statements check if the expression is true or false and then runs or doesn’t run the code.
- D. Correct: The switch statement allows you to use cases. If the case matches the value of the switch expression, then a specific code block can run. A default case can also be used when no other cases match.
Share this MCQ