Can anyone tell me what the code num1 = (a >= b ? a : b); does?
Specifically the "?" and the ":"
Can anyone tell me what the code num1 = (a >= b ? a : b); does?
Specifically the "?" and the ":"
Ternary operator. That statement is equivalent to:Originally posted by Aakash Datt
Can anyone tell me what the code num1 = (a >= b ? a : b); does?
Specifically the "?" and the ":"
Code:if (a >= b) num1 = a; else num1 = b;