KVS DEC-2013
October 12, 2023KVS DEC-2013
October 12, 2023KVS DEC-2013
Question 5 |
How many characters does an escape sequence (\On, \Hn,\n,\f) in C++ consume?
1 | |
3 | |
2 | |
None of these |
Question 5 Explanation:
→ An escape sequence is a sequence of characters that does not represent itself when used inside a character or string literal, but is translated into another character or a sequence of characters that may be difficult or impossible to represent directly.
→ All escape sequences consist of two or more characters, the first of which is the backslash, \ (called the “Escape character”); the remaining characters determine the interpretation of the
escape sequence. For example, \n is an escape sequence that denotes a newline character.
→ If we treat it a character constant means one character
Note: An escape sequence is regarded as a single character and is therefore valid as a character constant.
→ All escape sequences consist of two or more characters, the first of which is the backslash, \ (called the “Escape character”); the remaining characters determine the interpretation of the
escape sequence. For example, \n is an escape sequence that denotes a newline character.
→ If we treat it a character constant means one character
Note: An escape sequence is regarded as a single character and is therefore valid as a character constant.
Correct Answer: A
Question 5 Explanation:
→ An escape sequence is a sequence of characters that does not represent itself when used inside a character or string literal, but is translated into another character or a sequence of characters that may be difficult or impossible to represent directly.
→ All escape sequences consist of two or more characters, the first of which is the backslash, \ (called the “Escape character”); the remaining characters determine the interpretation of the
escape sequence. For example, \n is an escape sequence that denotes a newline character.
→ If we treat it a character constant means one character
Note: An escape sequence is regarded as a single character and is therefore valid as a character constant.
→ All escape sequences consist of two or more characters, the first of which is the backslash, \ (called the “Escape character”); the remaining characters determine the interpretation of the
escape sequence. For example, \n is an escape sequence that denotes a newline character.
→ If we treat it a character constant means one character
Note: An escape sequence is regarded as a single character and is therefore valid as a character constant.
Subscribe
Login
0 Comments