Check if int is between two numbers

后端 未结 10 1048
夕颜
夕颜 2020-11-28 13:09

Why can\'t do you this if you try to find out whether an int is between to numbers:

if(10 < x < 20)

Instead of it, you\'ll have to do

10条回答
  •  忘掉有多难
    2020-11-28 13:49

    COBOL allows that (I am sure some other languages do as well). Java inherited most of it's syntax from C which doesn't allow it.

提交回复
热议问题