Larger than and less than in C switch statement

后端 未结 7 856
闹比i
闹比i 2020-12-29 04:57

I\'m trying to write a code that has a lot of comparison

Write a program in “QUANT.C” which “quantifies” numbers. Read an integer “x” and test it, pro

7条回答
  •  佛祖请我去吃肉
    2020-12-29 05:35

    There is no clean way to solve this with switch, as cases need to be integral types. Have a look at if-else if-else.

提交回复
热议问题