Mega Code Archive

 
Categories / C# Tutorial / Statement
 

Switch without Default

using System; class MainClass {    static void Main()    {       for (int x = 1; x < 6; x++)       {          switch (x)          {             case 5:                Console.WriteLine("x is {0} -- In Case 5", x);                break;          }       }    } } x is 5 -- In Case 5