C examples for Language Basics:printf
Sequence | Shortcut for or Equivalent to |
---|---|
\a | Beeps the speaker |
\b | Backspace (moves the cursor back, no erase) |
\f | Form feed (ejects printer page) |
\n | Newline, like pressing the Enter key |
\r | Carriage return (moves the cursor to the beginning of the line) |
\t | Tab |
\v | Vertical tab (moves the cursor down a line) |
\\ | The backslash character |
\' | The apostrophe |
\" | The double-quote character |
\? | The question mark |
\0 | The "null" byte (that's 0, not the letter O) |
\Onn | A character value in octal (base 8) |
\xnnn | A character value in hexadecimal (base 16) |
/* //from w ww .java 2s . co m printf() escape sequence demonstration program */ #include <stdio.h> int main() { printf("Here is the \\a sequence: \a"); getchar(); return(0); }