Skip Navigation

True or False: If a match expression doesn't match any case pattern and there's no default case, control falls through a switch statement.

learn.microsoft.com if and switch statements - select a code path to execute

The `if` and `switch` statements provide branching logic in C#. You use `if, `else` and `switch` to choose the path your program follows.

if and switch statements - select a code path to execute

What does "control falls through a switch statement" mean in this context? Control just moves on to the next statement?

I thought if there is no match and a default case doesn't exist it will raise an exception. Is it not true?

10
10 comments
10 comments