What are escape sequence characters in C?

Escape sequences are used to format the data.

It is the sequence of characters.

It starts with symbol ‘\'(backslash).

Ex: '\n' means newline.


List of escape sequences in C

Escape sequenceMeaning
\aBeep
\bBackspace
\fForm feed
\nNewline
\rCarriage return
\tTab
\vVertical Tab
\\Backslash
\'Single Quote
\"Double Quote
\?Question Mark
\nnnOctal number
\xhhHexadecimal number
\0Null

Example program

#include<stdio.h>
int main()
{
  printf("Hi\tall \n you People are learning \n \"C \" language \n");
  return 0;
}
Escape sequence in c programming

People also ask for

What are escape sequences in C?

Escape sequences are used to format the data. It is the sequence of characters. It starts with symbol ‘\'(backslash).


People also read