New Line

To insert a new line, you can use the \n character:


        #include<stdio.h> 

int main() {
printf("Hello World!\n");
printf("I am learning C.");
return 0;
}

You can also output multiple lines with a single printf() function.

However, be aware that this will make the code harder to read:


    #include<stdio.h> 

int main() {
printf("Hello World!\nI am learning C.\nAnd it is awesome!");
return 0;
}

Tip: Two \n characters after each other will create a blank line:


    #include<stdio.h> 

int main() {
printf("Hello World!\n\n");
printf("I am learning C.");
return 0;
}


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.


    #include<stdio.h> 

int main() {
printf("Hello World!\t");
printf("I am learning C.");
return 0;
}


    #include<stdio.h> 

int main() {
printf("Hello World!\\");
printf("I am learning C.");
return 0;
}


    #include<stdio.h> 

int main() {
printf("They call him \"Johnny\".");
return 0;
}