Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

switch case c++

int a;
cout <<"Enter one number"<<endl; 
cin>>a ;
switch(a){
	case(1): // means ==> if a=1 
		cout<<"Your number is 1";
		break;
	case(2):
		cout<<"Your number is 2";
		break;
	default:
		cout<<"Other cases";
}
 
PREVIOUS NEXT
Tagged: #switch #case
ADD COMMENT
Topic
Name
6+4 =