Switch with only default : Switch : Statement C# Examples


C# Examples » Statement » Switch »

 

Switch with only default









    
using  System;

class  MainClass
{
      static  void  Main()
      {
            for  (int  x  =  1;  x  <  4;  x++)
            {
                  switch  (x)
                  {
                        default:
                              Console.WriteLine("x  is  {0}  --  In  Default  case",  x);
                              break;
                  }
            }
      }
}
    
   
  
   



Output

x is 1 -- In Default case
x is 2 -- In Default case
x is 3 -- In Default case


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Statement
» Switch