Sunday , January 26 2020
Home / C / C #05 – Escape Sequences in C Language

C #05 – Escape Sequences in C Language

Escape sequences

Escape sequences are used to represent certain special characters within string literals and character literals.

Escape
sequence
Description Representation
\’ single quote byte 0x27 in ASCII encoding
\” double quote byte 0x22 in ASCII encoding
\? question mark byte 0x3f in ASCII encoding
\\ backslash byte 0x5c in ASCII encoding
\a audible bell byte 0x07 in ASCII encoding
\b backspace byte 0x08 in ASCII encoding
\f form feed – new page byte 0x0c in ASCII encoding
\n line feed – new line byte 0x0a in ASCII encoding
\r carriage return byte 0x0d in ASCII encoding
\t horizontal tab byte 0x09 in ASCII encoding
\v vertical tab byte 0x0b in ASCII encoding
\nnn arbitrary octal value byte nnn
\xnn arbitrary hexadecimal value byte nn
\unnnn universal character name
(arbitrary Unicode value);
may result in several characters
code point U+nnnn
\Unnnnnnnn universal character name
(arbitrary Unicode value);
may result in several characters
code point U+nnnnnnnn

 

 

//file name P05.C
void main()
{
    int i=10;
    char c='A';
    float pi =3.14;

    clrscr();
    printf("\"Welcome To Online Teaching Hub\"");
    printf("The Integer Value Is:\t");
    printf("%d\n",i);
    printf("The Character Value Is:\t");
    printf("%c\n",c);
    printf("The Float Value Is:\t");
    printf("%e\n",pi);
    getch();

}

About Faheem

Faheem
An adaptable and responsible Software Engineer, who enjoys working with computers and the opportunity to learn new skills and work with new technologies is particularly attractive to me.

Check Also

C #08 – Loops and For Loop in C Language

  Loop in C Language A loop statement allows us to execute a statement or …

Leave a Reply

Your email address will not be published.