in switch cases in c# how to write default case for integers code example
Example: c# switch case set value
int x = SwitchExpressionUsingGuardClause(y);
// Keywords: Switch Expressions, C# 8.0, Guard Clause
private int SwitchExpressionUsingGuardClause(int y)
{
switch (y)
{
case 0: return 10;
case 1: return 20;
default: return 5;
}
}