Question 28

How many characters does an escape sequence (\On, \Hn, \n, \f) in C++ consume?

  1. A1
  2. B3
  3. C2
  4. DNone of these
Show answerHide answer

Correct answer: (A) 1

Explanation

An escape sequence is written with two or more characters in the source code, but it represents and stores a single character, so it takes 1 character (1 byte).

From DSSSB TGT Computer Science Practice Set 2

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