+ 1

C++

What did I do wrong, somebody help me, please. #include <iostream> using namespace std; int main() { //измените данный код cout << "C" <<\n; cout << "+" <<\n; cout << "+"; return 0; }

17th May 2021, 1:24 PM
Diana Bielinska
Diana Bielinska - avatar
3 odpowiedzi
+ 3
\n is a character so it comes within double quote (" ") write "\n" ; you can use endl (end line ) also (without quotes)
17th May 2021, 1:28 PM
Giriraj Yalpalwar
Giriraj Yalpalwar - avatar
+ 4
Thirt13n Diana Bielinska Don't always have to be within double quotes like mentioned tho. Even with single quote works... because \n is an escape sequence/character for newline. cout << "sololearn" << '\n';
17th May 2021, 1:52 PM
minirkk
minirkk - avatar