Important MCQ

The ternary operator ?: is a short form of

Q.The ternary operator ?: is a short form of

A) while loop
B) if-else
C) switch
D) for loop
Correct Answer:
Option B
Detailed Explanation:
B) if-else is correct. An if-else statement makes a two-way decision: the if block runs when the condition is true, otherwise the else block runs. Exactly one branch is selected.