+ 1
How to find the larger number between two numbers using switch case statements in C language?
I know how to write a program for the above question using the if-else statements but its really confusing to do it using switch case. Could anyone explain the logic and steps on how to solve this problem? Thanks!!
3 Respuestas
0
Thanks alot Supriya Gangapatnam. I just wanted to know wheather inequalities were allowed in switch case. I thought only the == relational operator could be used in switch case which is why i was confused as to how to solve a problem that required a > or < operator.
I also dont understand the cases. You didnt declare a boolean variable anywhere so how come the outcomes of switch(a>b) be 0(false) and 1(true) ?