0

How do I display different outputs on separate lines?

https://sololearn.com/compiler-playground/cSjXQXQzL18H/?ref=app

28th Jun 2024, 3:31 PM
Machete Vhuthuhawe Irvin
Machete Vhuthuhawe Irvin - avatar
5 Answers
+ 8
Machete Vhuthuhawe Irvin , use an additional `<<` just before `endl` in both lines.
28th Jun 2024, 3:36 PM
Lothar
Lothar - avatar
+ 3
code : cout << "line1\nline2" output : line1 line2
28th Jun 2024, 4:44 PM
Andrew [DEAD]
Andrew [DEAD] - avatar
+ 2
Lothar Thanks
28th Jun 2024, 8:06 PM
Machete Vhuthuhawe Irvin
Machete Vhuthuhawe Irvin - avatar
+ 1
Andrew Thanks It's my first time with c++, I'm used to Python
28th Jun 2024, 8:08 PM
Machete Vhuthuhawe Irvin
Machete Vhuthuhawe Irvin - avatar
0
use '\n' or endl to display output on separate lines
30th Jun 2024, 7:44 AM
Alhaaz
Alhaaz - avatar