0
What is the use of endl
10 Respuestas
+ 4
with endl u go to the next line
+ 3
endl is used to move the cursor to next line
Eg:-
cout<<5<<endl;
cout<<3;
Output will be:-
5
3
+ 3
now i swiched form learning c++ to learning java i'll come back later
+ 2
<< std::endl; or if using namespace <<endl; is used to end the line followed by next line. So you can have:
cout<<"i will use next line with \n";
Or
cout<<"using endl will end the line and go to next line" <<endln
Note you can use \n with endl. Basically endl is ending end line.
Hope that helps :)
+ 2
or endl;
+ 1
\n
+ 1
a new line
+ 1
endl is used when we have to start new line and end the line we are working on
0
'end' is used to tell the compiler to print the information on separate lines
0
Endl is used when we want to end the line