Question 65

Which of the following is not correct in C++?

  1. Ax−=2; is the same as x = x−2;
  2. Bx*= 2; is the same as x = x*2;
  3. Cx% =2; is the same as x = x/2;
  4. Dx/=2; is the same as x = x/2;
Show answerHide answer

Correct answer: (C) x% =2; is the same as x = x/2;

Explanation

x %= 2 means x = x % 2 (remainder), not x = x / 2 (division). So (C) is incorrect.

From DSSSB TGT Computer Science Practice Set 4

This is question 65 of DSSSB TGT Computer Science Practice Set 4. 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.