Escape Sequences: Performs specific action when we use inside the String.
\b | Backspace |
\n | New line |
\r | Carriage return |
\t | Horizantal tab |
\v | Vertical tab |
\\ | Backslash |
\’ | Single quote |
\” | Double quote |
\0 | Null |
Display String in multiple lines:
#include<stdio.h> int main () { printf(“String \ndisplayed \nin \nMultiple \nLines”); return 0; } |
Display information with tab spaces:
#include<stdio.h> int main () { int a=10, b=20, c=30; printf(“%d\t%d\t%d”, a, b, c); return 0; } |
Display Message with Single Quotations:
#include<stdio.h> int main () { printf(“‘C’ Tutorial\n”); return 0; } | #include<stdio.h> int main () { printf(“\’C\’ Tutorial\n”); return 0; } |
Display Message with Double Quotations:
int main () { printf(“\”C-Language\” Tutorial\n”); return 0; } |