Sail E0 Webinar
Question

What should be expression1 evaluate to in using ternary operator as in this line?
expression1 ? expression2 : expression3


Options:
A .  Integer
B .  Floating - point numbers
C .  Boolean
D .  None of the mentioned
Answer: Option C

The controlling condition of ternary operator must evaluate to boolean.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers