www.RickLaFleur.com

 

csharp switch statement


for (int i = 1; i < 10; i++)
 switch (i)
 {
  case 1:
  case 2:
  case 3: 
   Console.WriteLine("i is 1, 2 or 3");
   break;
  case 4: 
   Console.WriteLine("i is 4");
   break;
  default:
   Console.WriteLine("i not 1, 2, 3, or 4");
   break;
 } 
}

Labels:


Comments: Post a Comment



Links to this post:

Create a Link



<< Home

Archives

January 2007  |   March 2007  |   May 2007  |   February 2008  |   April 2008  |   July 2008  |   September 2008  |   October 2008  |   December 2008  |  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]