ternary operator precedence is right to left
but we first check condition and after execute particulaer according to condition (it signify ternary operator precedence left to right )
CPP - Operator Associativity and Precedence
The ternary operator is defined by ?: not just ?. So the meaning of Associativity being right to left is that if there are two or more ternary operator then rightmost will be executed first. means
a?b:c?d:e then operator c?d:e will be executed first then a?b:c.