Line break in C++ by R4R Team

There are two way to break the line in C++:
-using 'n'
-using 'endl'

without endl :

program-

#include< iostream>
int main()
{
cout<<"Hello World";
cout<<"Hello India";
return 0;
}


output-

Hello WorldHello India


With the use of the endl:

program-

#include< iostream>
int main()
{
cout<<"Hello World"<< endl;
cout<<"Hello India";
return 0;
}


output-

Hello World
Hello India

-In this program, we use endl which break the line and next statement is display on next line as you see in output




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!