switch statement in c++

switch statement in c++



// switch statement in c++


int x;        // variable
cin >>x;       // input
switch (x)       // switch(expression)
   {
	   case 1:      
	   cout<<"this is the case one "<<endl;
	   
	   break;
	   case 2:
	   cout<<"this is the case  two "<<endl;
	   break ;
	   
	   
	   default : cout<<"nothing"<<endl; // the default result
	   
	   
	   
	   }