What is the newline escape sequence?

The new line escape sequence is represented by “\n”. It inserts a new line on the output screen.

In C, the newline escape sequence is represented by \n. It is used to move the cursor to the beginning of the next line when it’s encountered in a string. This is commonly used in printing text to the console or in formatting output.

For example:

c
#include <stdio.h>

int main() {
printf("Hello, world!\nThis is a new line.\n");
return 0;
}

Output:

arduino
Hello, world!
This is a new line.

In this example, \n causes the text “This is a new line.” to be printed on a new line in the console.