The format of the ternary operator is
condition ? true_statement : false_statement;
which means when
condition
is true the
true_statement
is executed and when it is false the
false_statement
is executed.
It will probably help to rewrite the expression so you can see the true and false statements of each subexpression :
a > b
? a > c
? printf("a")
: a == c
? printf("a c")
: printf("c")
: b > c
? printf("b")
: b == c
? printf("b c")
: b == a
? printf("a b")
: printf("b");