- 1

How to print // in c++

If user want to print //

12th Dec 2019, 7:42 PM
Rajnish Sharma
Rajnish Sharma - avatar
3 Answers
+ 2
cout << "//"; works https://code.sololearn.com/c57NOGztr61V Is this what you wanted ?
12th Dec 2019, 10:13 PM
sneeze
sneeze - avatar
+ 2
If you want to print // , then write : cout << "//"; but if you want to print \\ ,then write : cout << "\\\\";
12th Dec 2019, 10:20 PM
Mona Mohamed
Mona Mohamed - avatar
0
Can't you just do the regular? std::cout << "//"; What did you mean "user wants to print //" ? Can you show your code so the problem can be seen more obviously?
12th Dec 2019, 10:11 PM
Ipang