Sign up to request clarification or add additional context in comments.
Comments
2
You can handle this with one ternary expression:
a = x > 0 ? 100 : 1;
b = a;
This works because the assignment logic for both a and b happens to be the same. If that were not the case, we would need two separate ternary expressions: