Question Bank (1 mark) · Q26
Q.Where is conditional operator used?
Karnataka PUCTextbookShort· 1mImportance★★★★★est
79% · 121/154 Questions
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →[!TLDR]
The conditional operator ?: selects a value based on a condition, replacing a simple if-else.
The conditional operator, written as ?:, takes three operands and has the form condition ? expr1 : expr2. If the condition is true, expr1 is evaluated; otherwise expr2 is evaluated. It is used wherever a value has to be chosen based on a test, for example big = (a > b) ? a : b; to store the larger of two numbers. It gives a c …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.