+ 3
How to use switch statement
4 Respuestas
+ 7
The switch statement is an Alternative to multiple if statements
var a=1;
switch(a):
case 1: //that if a is equals 1
cout<<1;
break;
case 2: //that is if a equals 2
cout<<2;
break;
The output is "1" since a equals 1
+ 2
swich operator is use to multiple operation on a single expression
0
Swich statement is used to multiple if else or nasted if else statement in a program...
Swich (text) {
case 1:
Break;
case2:
Break;
.
.
.
Default expression
}