Question 87Asked in DSSSB PGT Computer Science (Technical), 11 Jul 2021

What is the symbol and associativity of the assignment operator in C++?

  1. A=, left to right
  2. B==, left to right
  3. C(R), right to left
  4. D=, right to left
Show answerHide answer

Correct answer: (D) =, right to left

Explanation

The assignment operator is = and it associates right to left, so a = b = c assigns c to b first, then b to a.

From DSSSB PGT Computer Science PYQ (Technical), 11 Jul 2021

This is question 87 of DSSSB PGT Computer Science PYQ (Technical), 11 Jul 2021. 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.