Mega Code Archive

 
Categories / Visual C++ .NET / Statement
 

Create a switch Statement

#include "stdafx.h" #using <mscorlib.dll> using namespace System; int main(void) {     int x = 2;     switch (x)     {     case 1:         Console::WriteLine("Case 1");         break;     case 5:     case 6:         Console::WriteLine("Case 5 or 6");         break;     default:         Console::WriteLine("Default case");     }     return 0; }