Question 60Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)

Consider the expression given below in C. x ? y : a ? b : c

Consider the expression given below in C. x ? y : a ? b : c What will be the value of the given expression if x = 0 and a = 0?
  1. AEquivalent to the value of y.
  2. BEquivalent to the value of c.
  3. C0
  4. DEquivalent to the value of b.
Show answerHide answer

Correct answer: (B) Equivalent to the value of c.

Explanation

The ?: operator is right-associative, so the expression is x ? y : (a ? b : c). x = 0 picks the second part, and a = 0 then picks c.

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 3 (5:00 PM)

This is question 60 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 3 (5:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.