Suppose you have an if, else form of the if statement. If you want to replace it

Question:

Suppose you have an ‘if, else” form of the if statement. If you want to replace it with a switch construct, can you use the if statement’s condition as the controlling expression in the switch header?
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: