Question 117Asked in DSSSB TGT Computer Science, 24 Jun 2023, Shift 3 (4:30 PM)

In C++ language, the instruction 'ignore(x,y);'

  1. Askips the last x characters and stops if character y is encountered
  2. Bskips the first y characters and stops if character x is encountered
  3. Cskips the first x characters and stops if character y is encountered
  4. Dskips the last y characters and stops if character x is encountered
Show answerHide answer

Correct answer: (C) skips the first x characters and stops if character y is encountered

Explanation

cin.ignore(x, y) discards up to x characters from the input, or stops earlier once the delimiter character y has been read and discarded.

From DSSSB TGT Computer Science PYQ, 24 Jun 2023, Shift 3 (4:30 PM)

This is question 117 of DSSSB TGT Computer Science PYQ, 24 Jun 2023, Shift 3 (4:30 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.