Pages

Sunday, April 2, 2017

Escape Sequences

Followings are some of the escape sequences characters used in C language.

Escape Sequence
Characters
Description
Example
Output
\n
New line
printf(“Hello \n Student”);
Hello
Student
\t
Tab
printf(“Hello \t Student”);
Hello     Student
\a
Alert (Beep) sound
printf(“\a”);
You will listen a Beep sound
\0
Null
printf(“Hello \0 World”);
Hello
\r
Carriage return
printf("Gujarat\rINDIA");
INDIAat
\"
To insert double quote
printf("\"INDIA\"");
"INDIA"
\'
To insert single quote
printf("Gujarat\'s");
Gujarat's
\\
To print \
printf("On\\Off");
On\Off







No comments:

Post a Comment