DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Swithc Case: Compare Against More Than One Constant

03.26.2012
| 1065 views |
  • submit to reddit
        Swithc case: Compare against more than one constant

        int standard = 10;
	switch (standard)
	{
	   case 5:
	   case 6:
	   case 7:
	   case 8:
	   case 9:
	   case 10:
		Console.WriteLine("Secondary Schooling");
		break;
	   case 11:
	   case 12:
		Console.WriteLine("Higher Secondary Schooling");
		break;
	}