+ 3

Some times we use (cout<<"/n" <<"/n" ; ) why do we use /n double time ?

15th Feb 2018, 11:00 AM
S Prajwal
S Prajwal - avatar
3 Réponses
+ 11
\n equals a new line. two \n equals two new lines. It is easier to write cout << "\n\n"; than cout << " \n" << "\n" ; it is the same.
15th Feb 2018, 11:05 AM
jay
jay - avatar
+ 4
You could have stuff bw the lines breaks: cout<<"something\nsomething else\nanotherthing";
15th Feb 2018, 11:20 AM
J.G.
J.G. - avatar
+ 1
We use \n two times to leave a blank line.
16th Feb 2018, 1:35 AM
Anil