C escape sequence
Some characters newline, backspace, tab can’t be display like other characters or string. so there is c supports the combination of backslash (\) . These all character combinations are called escape sequences or known as escape sequences. And these represents by two characters. so the first character is “\” and the second character is from the C character set. here in the below some Escape sequence in C characters are given below-
Escape sequence |
Meaning |
ASCII value |
Purpose |
\b |
backspace |
008 |
Moves the cursor to the previous position of the current line. |
\r |
carriage return |
013 |
moves the cursor to the beginning of the current line |
\a |
alert |
007 |
produce a audio |
\f |
form feed |
012 |
moves the cursor to the initial position to the next page |
\n |
new line |
010 |
in this move the cursor to the beginning of the next line |
%0 |
Null character |
000 |
used for termination of the character string |
v |
verticle tab |
011 |
moves the cursor to next verticle position |
\t |
Horizontal tab |
009 |
moves the cursor to next horizontal position |
\\ |
backslash |
092 |
print the character with backslash (\) |
Let us take example to understand escape sequence
main()
{
marks;
printf("\t MY NAME IS NITISH SARASWAT");
printf("\n IAM FROM INDIA");
0;
}
|
horizontal tab, blank, vertical tab, newline, ,form feed, carriage return are know as whitespace in c language