0

All \n for every cout should be set in one line. Isn't it?

30th Aug 2019, 2:31 PM
Ahmed Salimi
Ahmed Salimi - avatar
12 ответов
+ 2
No, you can put as many of that as you want into a string, wherever you need them. cout << "We go on\n\nafter an empty line!";
30th Aug 2019, 2:34 PM
HonFu
HonFu - avatar
+ 2
You have forgotten the closing ".
30th Aug 2019, 2:47 PM
HonFu
HonFu - avatar
+ 2
Whatever you want to output, has to be enclosed within these two ". And the line break, which you write \n, is no exception.
30th Aug 2019, 2:54 PM
HonFu
HonFu - avatar
+ 1
Sorry for typing error but Even if i put it after (there?)
30th Aug 2019, 2:51 PM
Ahmed Salimi
Ahmed Salimi - avatar
0
Yes but all of them should be on one line. Right?
30th Aug 2019, 2:37 PM
Ahmed Salimi
Ahmed Salimi - avatar
0
\n mean ends the line which u r in Then move to next line prints the contant Cout<<"this is sandhya\ndasari"; Output: this is sandhya dasari
30th Aug 2019, 2:39 PM
👀 Sandy👀
👀  Sandy👀 - avatar
0
For this: int main () { cout << " Whats \n up \n there? return 0; } It gives me this error: missing terminating character
30th Aug 2019, 2:44 PM
Ahmed Salimi
Ahmed Salimi - avatar
0
At the line beginning with cout
30th Aug 2019, 2:45 PM
Ahmed Salimi
Ahmed Salimi - avatar
0
At the end of cout place " and ;
30th Aug 2019, 3:17 PM
👀 Sandy👀
👀  Sandy👀 - avatar