[Solved] Which comparison will go first? (c#) [duplicate]


You can rewrite what you just wrote like this:

a > 5 ? ( a > 10 ? 10 : 5 ) : 0

After all, there is no other way you could arrange the parentheses that would make sense. Therefore, the a > 5 comparison must be tested first because if a > 5 does not evaluate to true, then the second comparison is not necessary.

1

solved Which comparison will go first? (c#) [duplicate]