1.

Explain ternary operator with examples.​

Answer»

Answer: Ternary operator is a operator which work with three operands to perform the operation.It is otherwise CALLED as conditional operator(?:).

Syntax:  (expression 1)?expression 2:expression 3;

if the expression 1  in the above statement evaluates to true, then expression 2 will be EVALUATED else expression 3 will be evaluated.

          Example:     (M>35)?P:F;



Discussion

No Comment Found