I'm not sure, but I think you can depending on the compiler. In VB, I can do this, so I think you can do this in VC++ as well. I don't know about other compilers though.
---------- Post added at 05:24 ---------- Previous post was at 05:22 ----------
However in VB, I would use
Code:
case (> 1 and <10)
You don't need to mention A in the case function as A is the variable which you are testing. Why don't you try it out and see?
The above switch statement is invalid in C and C++. The case label must consist of the reserve word, "case" followed by a constant expression and ending with a colon.