Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyC#pattern matching switchSingle-choice MCQ

What happens if a switch expression has no arm that matches the input?

string Name(int n) => n switch { 1 => "one", 2 => "two" }; Console.WriteLine(Name(5));