What are Escape Sequences in C Programming?

Escape sequences are also known as Backslash Character Constants. In C, backslash ( \ ) is known as escape character because it causes an escape from the normal interpretation of string, so that the character is recognized as one having a special meaning.

A backslash ( \ ) followed by one or more special character is known as escape sequence. The escape sequence is used to express some action.

Escape Sequences in C Language

  1. \n : New Line
  2. \t : Horizontal Tab
  3. \r : Line Feed or Carriage Return (Takes the cursor to the beginning of line in which it is currently placed)
  4. \f : Form Feed
  5. \b : Move cursor one position the left of its current position
  6. \" : Double Quote
  7. \\ : Display Backslash
  8. \a : Alert (It alerts by sounding the speaker inside computer)
  9. \0 : It represents NULL character