In c++ why do we sometimes put /n inside double quotes along with the string? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

In c++ why do we sometimes put /n inside double quotes along with the string?

Why do we use /n along with the string in the same double quote? For eg cout<<"my name is parth \n";

18th Feb 2017, 3:45 AM
Parth Kapadia
Parth Kapadia - avatar
4 Answers
+ 1
well its simple it does the same thing as /n in inverted commas just a short and another way of doing that.
13th Jul 2017, 12:12 PM
Parth Kapadia
Parth Kapadia - avatar
+ 2
\n is to go to the next line
18th Feb 2017, 7:29 AM
Akshata
Akshata - avatar
+ 1
/n and <<endl do the same things. cout<<"some things /n"; and cout<<"some things<<endl; print the same thing
18th Feb 2017, 11:55 AM
Orfeo Terkuci
Orfeo Terkuci - avatar
- 1
because our long disgusting fingers miss the buttons
18th Feb 2017, 4:37 AM
Hyper89