Download Our Mobile App
To output values or print text in C, you can use the printf() function:
To insert a new line, you can use the \n character:
You can also output multiple lines with a single printf() function. However, be aware that this will make the code harder to read:
Tip: Two \n characters after each other will create a blank line:
What is \n exactly?
The newline character (\n) is called an escape sequence, and it forces the cursor to change its position to the beginning of the next line on the screen. This results in a new line.