In reply to arrpaduru:
Your problem is the precedence of the equality ‘==’ operator is higher than the conditional operator ‘?:’. What you wrote gets interpreted as:
( b == (a<2) ) ? 2 : 3;
This leaves b unconstrained since any value of b results in the expression being non-zero(true).