Escape Sequence in C

Escape Sequence in C Programming is used to format the output. The general and most commonly used escape character is \n (to generate a Newline).

The list of available escape sequences in this C Programming language.

Escape SequenceOperation
\aAlarm or Beep
\fForm Feed
\nNew Line
\rCarriage Return
\tHorizontal Tab
\vVertical Tab
\’Single Quote
\”Double Quotes
\?Question Mark
\nnnOctal Number
\xhhHexadecimal Number

Escape Sequence in C Example

In this program, we are using some of the escape sequence characters inside the printf statement. Through this, we can show their functionality and how to use them in C Programming.


int main()
    // Horizontal Tab
    printf("Tutorial\tGateway \n");
    //New Line
    printf("Welcome To \nTutorial Gateway \n");
    // Single Quote, and Question Mark
    printf("Learn \'C\' Programming\? \v Visit Tutorial Gateway \n");
    // Vertical Tab
    // Double Quotes
    printf("\"Tutorial Gateway\" ");
    // Carriage Return
    return 0;
Escape Sequence in C Programming Example