Can switch case be used within an if else statement? If so can someone please give an example with the proper syntax?
4 Answers
New Answer10/17/2019 6:44:56 AM
beastmaster644 Answers
New AnswerWhy is the question "can"? Why can't you just try it out? Why is there a hesitation in trying out things, I am sure you know the syntax of switch-case. All you need is a little bit of imagination and logic. In the course you have seen the use of switch-case in the main directly, all you have to do is to move the whole code in if-else and you are done !
Hello everyone, just here to let you guys know that i did try it myself but the problem is that the if statement is being executed irrespective of whether the condition was true or false. So it'd be very nice if someone could write an example code for me. Thankyou for your time
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message