Written by - Vanshika Yadav

Escape Sequence in C


When a character is preceded by a backslash (\) it is called an escape sequence.

For example, \n represents the new line.

Escape sequenceMeaning
\aAlarm or beep
\bBackspace
\fForm feed
\nNewline
\rCarriage return
\tTab(horizontal)
/vVertical Tab
\'Single Quote
\\Blackslash
\?Question Mark
\"Double Quote

Now,let’s see the example of escape sequence:

//escape sequence
#include<stdio.h>
int main(){
    printf("hey there!\nhere we are learning the C with\nprosequence.tech");
}
Output
hey there!
here we are learning the C with
prosequence.tech