C does not understand math-like syntax, so
if(1<j<=5)
is not interpreted as you expect and want; it should be
if (1 < j && j <= 5)
or similar.
As explained in other answers, the expression is evaluated as
((1 < j) <= 5)
=> ("true" <= 5)
=> "true"
where "true" (boolean value) is implicitly converted to 1, as explaneid e.g. here, with references to standards too, and this explain why "true" has to be "less than" 5 (though in C might not be totally correct to speak about "implicit conversion from bool to int")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…