// Precedence of the right-associated ? operator a = b ? c : d ? e : f; // means a = b ? c : ( d ? e : f ); // not a = ( b ? c : d ) ? e : f; // However fellow programmers will curse your name // if you don't write it out with parentheses: a = b ? c : ( d ? e : f );