What does the statement indicate?
big = a > b ? a: b;
Answers
Answered by
1
this statement explain that the variable as two options if the statement is true then the programmer will go for a or otherwise if the statement is false then the programmer will go for B
Answered by
1
Ternary operator
Explanation:
The statement represents conditional operator or ternary operator.
Three parts are included in this operator:
First Part : big = a > b ? a : b
First part(a>b) is written before '?' called conditional expression that returns Boolean value true or false.
Second Part : big = a > b ? a : b
Second part(a) is written after ? and before : and it is returned only when conditional expression of the first part(a>b) is true.
Third Part : big = a > b ? a : b
Third part(b) is returned only when the conditional expression(a>b) is false.
big will store only single value, only a or only b(not both).
Similar questions