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 :-)

21st Nov 2017, 12:19 AM
OmerGamie
OmerGamie - avatar
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
21st Nov 2017, 12:29 AM
OG Pew
OG Pew - avatar
+ 1
new line. like '\n'
21st Nov 2017, 12:26 AM
OG Pew
OG Pew - avatar
+ 1
endl flushes the stream and adds the new line character.
21st Nov 2017, 1:01 AM
aklex
aklex - avatar