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}
<
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 developers prefer the "constant on the left" style of logical statement because it will cause a compilation error in certain error-prone comparisons. For example:
Let's say you wanted to evaluate if (X == 3) but accidentally typed if (X = 3).
The latter is a perfectly valid C expression because the assignment operation returns True.
If you were to use the "constant on the left" style:
if (3 = X) would cause a compilation error, thus save a lot of time.