C examples for Language Basics:printf
The escape sequence \n tells the program to add a new line.
Take a look at the following program statement.
The following table describes some common escape sequences.
Escape Sequence | Purpose |
---|---|
\n | Creates a new line |
\t | Moves the cursor to the next tab |
\r | Moves the cursor to the beginning of the current line |
\\ | Inserts a backslash |
\" | Inserts a double quote |
\' | Inserts a single quote |
How many new lines are added to standard output with this one printf() function?
#include <stdio.h> int main()/*from w w w. j a v a2 s .c om*/ { printf("\nC you \nla\nter\n"); return 0; }