DEV Community

Umid2008
Umid2008

Posted on

New line

the programmer will learn today, what we do is look at the new string throw in the C++ programming language.
You can use the" \n " icon to insert a new line:

For example::

#include <iostream>
using namespace std;

int main ().
{

cout < < < "I started learning C++\n" < br>;
cout < < < "very interesting and easy to learn";

return 0;
}

Tip: Two \N characters after each other form an empty row:

For example::
#include <iostream>
using namespace std;

int main ().
{

cout < < < "my advice to you start programming from C or C++\N\n";
cout < < < " Qani kettik;

return 0;
}
Another way to enter a new line is to use the Special Command "endl:

For example::
#include <iostream>
using namespace std;

int main ().
{

cout < < "I am learning C++" < < endl;
cout < < < "Hello World" < Br>;

return 0;
}
Enter fullscreen mode Exit fullscreen mode

To cut lines, "\n" and "endl" are also used. However, "\n " is the most commonly used.

But what exactly is \n?
The new row symbol (\n) is called the escape sequence, and it is curso

Top comments (0)