Switch without Default : Switch : Statement C# Examples


C# Examples » Statement » Switch »

 

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;
                  }
            }
      }
}
    
   
  
   



Output

x is 5 -- In Case 5


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Statement
» Switch