Sail E0 Webinar
Question
If $a = 12 what will be returned when ($a == 12) ? 5 : 1 is executed?
Options:
A .  12
B .  1
C .  Error
D .  5
Answer: Option D


?: is known as ternary operator. If condition is true then the part just after the ? is executed else the part after : .



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers