Why 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