0
<<endl; use
when i write a code for ex. to sum two numbers, at the end of the code to print the result,what is the use of typing <<endl; when i don't write still getting correct results . please i want a detailed explanation....thanks in advance :-)
4 Answers
+ 2
if I write int x=5,y=3;
cout<<x;
cout<<y;
I have 53
now if I write
int x=5,y=3;
cout<<x<<endl;
cout<<y;
I have
5
3
+ 1
new line. like '\n'
+ 1
endl flushes the stream and adds the new line character.