1.

Consider the following code The new line character is \n. The output of the following code does not contain the \n. Why it is happened? Explain.

Answer»

\n is a character constant and it is also known as escape sequence. This is used to represent the non graphic symbols such as carriage return key(enter key), tab key, backspace, space bar, etc. It consists of a backslash symbol and one more characters.

Escape sequenceNon graphic character
\aAudible bell
\bback space
\nfor new line
\rcarriage return
\thorizontal tab
\vvertical tab
\\to print\
\'to print'
\''to print"
\?to print ?
\0null character


Discussion

No Comment Found

Related InterviewSolutions