printf() Escape Sequences : printf Basics « printf scanf « C Tutorial






SequenceMeaning
\aBeeps the speaker
\bBackspace (moves the cursor back, no erase)
\fForm feed (ejects printer page; may clear the screen on some computers)
\nNewline, like pressing the Enter key
\rCarriage return (moves the cursor to the beginning of the line)
\tTab
\vVertical tab (moves the cursor down a line)
\\The backslash character
\'The apostrophe
\"The double-quote character
\?The question mark
\0The "null" byte (that's 0, not the letter O)
\OnnA character value in octal (base 8)
\xnnnA character value in hexadecimal (base 16)










4.1.printf Basics
4.1.1.The printf Function
4.1.2.The printf() Conversion Characters and flags
4.1.3.Placeholders
4.1.4.d, i: Signed integers
4.1.5.printf() Escape Sequences
4.1.6.The printf() function redirects the output to a standard output, which is the output on screen
4.1.7.A format specifier: how to print the data
4.1.8.Use multiple conversion specifiers in a single printf statement
4.1.9.Do calculation in printf