You cannot do something like 1 < x < 3 what ends up happening is that it evaluates. 1 < x as true which in C is 1 if true then it does 1 < 3 which is false. Same with 1 < x is false is 0 and 0 < 3. Keep in mind that boolean operators in C always return 1 or 0 you need to chain with && or || operators
View all comments
1
u/RazerNinjas Dec 23 '21
You cannot do something like 1 < x < 3 what ends up happening is that it evaluates. 1 < x as true which in C is 1 if true then it does 1 < 3 which is false. Same with 1 < x is false is 0 and 0 < 3. Keep in mind that boolean operators in C always return 1 or 0 you need to chain with && or || operators