Compound relational operators in C
问题 I am trying to convert a piece of pseudo code into a C code and I have conditions like if (-4 <= X <=8) THEN {Do Something} else {Do something else} Is the syntax in if statement valid? Can a constant be placed before the variable in the logical condition to check the truth value? 回答1: Yes you can have constants as the left hand argument of a logical check in C. However the pseudocode you have listed would need to be split into two expressions: if ((-1 <= X) && (X <= 8)) Side Note: Many