How do you output \\ symbol using cout?
Maybe
cout << "\\";
The '\' character is an escape character in C and C++. You can output a literal '\' by escaping it with itself:
cout << "This is a backslash: \\";
std::cout << '\\';
cout << "\\" << endl;
Instead of endl you could:
cout << "\\ \n";
Use two backslashes \\
In addition to all the correct answers, see this for further escaped characters
\a Bell (beep)
\b Backspace
\f Formfeed
\n Newline
\r Return
\t Tab
\\ Backslash
\' Single quote
\" Double quote
\xdd Hexadecimal representation
\ffffd Octal representation
\? Question mark ('?')