Can we place the default case between other case statements (i.e., not at the bottom)?
using System; class Program { static int score; static void Main(string[] args) { switch (score) { case 1: Console.WriteLine("Poor performance"); break; case 2: Console.WriteLine("Good performance"); break; default: break; case 3: Console.WriteLine("Excellent performance"); break; } } }
Yes
We place the default case between other case statements.