You can use the “\n” character to introduce a new line.
#include <stdio.h>
int main() { |
Using a single printf() function, you can output multiple lines, although it may potentially make the code less readable.
#include <stdio.h>
int main() { |
Tip: Consecutive “\n” characters will generate a blank line.
#include <stdio.h>
int main() { |
\n
exactly?The newline character (\n) serves as an escape sequence, directing the cursor to move to the
start of the subsequent line, causing a line break.
Other examples of valid escape sequences include:
Escape Sequence |
Description |
\t |
Creates a horizontal tab |
\\ |
Inserts a backslash character (\) |
\” |
Inserts a double quote character |