Turn Desktop View Off
You are here:   HomeC Programming (Theory)Basic Of C Prog.Escape Sequences in C
by Dinesh Thakur Category: Basic Of C Programming

Escape sequences are basically control characters used for formatting the output. These are combinations of a backslash and a character in lowercase. We have already used "\n", which shifts the curser to the next line. Table lists the escape sequences defined in C language.

  Escape Sequences in C

Illustrates application of some escape characters.

#include <stdio.h>

int main ()
   printf("\a Hello!\nHow are you?\n");
   printf("I am learning C.\n");
   printf ("\tAm I physically fit?");
   printf ("\nAm\tI physically" " fit?\n");
   return 0;

The output of this program is as given below. Because of code "\a" you will hear a beep sound. Compare the spaces specified in the code with those obtained in the output.

Escape Sequences

Subscribe To Free Daily Newsletter!

Get Free News Updates Delivered Directly To Your Inbox
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to contact us.

What's New and Popular

Popular Article