Examveda

What is the purpose of the 'switch' statement in C#?

A. To define a method

B. To handle exceptions

C. To iterate over a collection

D. To execute different blocks of code based on the value of an expression

Answer: Option D


Join The Discussion

Related Questions on Control Flow Statements in C Sharp