Escape Sequences in C Language

Escape Sequences in C – Character combinations consisting of a backslash (\) followed by a letter or by a combination of digits are called “escape sequences”.

Escape sequences provide a general and extensible mechanism for representing hard to type invisible characters.

List of Escape Sequences in C

Escape sequence Charecter What it does
\a Audible alert Rings the terminal’s bell.
\b Backspace Moves the cursor back one space.
\f form feed Moves the cursor to the next logical page.
\n new line Prints the new line.
\r carriage return Prints the carriage return.
\t horizontal tab Prints a horizontal tab.
\v vertical tab Prints a vertical tab.
\\ back slash Prints a backslash.
\? Question mark prints a question mark
\’ single quote Prints a single quote.
\” double quote Prints a double quote.


Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: