Why can't we use \n outside the inverted commas? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Why can't we use \n outside the inverted commas?

If \n is used inside the inverted commas is it not considered as a part of sentence of the program?

14th Jan 2019, 4:24 AM
Kiran Ghumare
6 Answers
+ 5
keywords (as of functions) in c++ are cout and printf. with them you initialize the command for printing on the screen. if you don't use \n in their syntax the c++ language doesn't know that you wanted to print it on the screen so it won't do that.
14th Jan 2019, 6:15 AM
notqueued
notqueued - avatar
+ 2
This /n and all commands are getting error in c++turbo app while make a program
28th Jan 2019, 8:20 AM
B. Shívá Krîšhñä
B. Shívá Krîšhñä - avatar
0
Cout
24th Jan 2019, 3:45 PM
Саша Куделькин
Саша Куделькин - avatar
0
The compiler doesn't understand that it is the part of a string and u want to print it on the screen
10th Feb 2019, 12:01 PM
abc
0
Use endl instead to jump to a new line
10th May 2019, 10:28 AM
Nickson Topte
Nickson Topte - avatar
0
But \n is still an alternative
10th May 2019, 10:29 AM
Nickson Topte
Nickson Topte - avatar