Question #4225

Can IF statements replace SELECT statements?

Expert's answer

C++ code
& example shows how to do it.
IF statements:

if(x==1){
...
}else if(x==2){
...
}else{
...
}

SELECT statements:

switch(x){
case 1:
...
break;

case 2:
...
break;

default:
...
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS