Chapter :-5 (English)
9. Conditional (Ternary) Operator
Conditional (Ternary) Operator
Definition:
A shorthand for if-else.
Syntax: condition ? value1
: value2
Advantages:
· Short and concise
· Reduces code size
Disadvantages:
· Reduces readability if overused
· Not suitable for complex logic