Computer Science, asked by nirvanaravina, 5 hours ago

How will you print \ in c++?​

Answers

Answered by anindyaadhikari13
4

Solution:

To print backslash '\' character in C++, write the co‎de given below.

#include <iostream>

int main() {

   std::cout<<"\\";

   return 0;

}

Explanation:

  • Line 1 - Instructs the preprocessor to include a section of standard C++ co‎de , known as header iostream.
  • Line 2 - Start of main() method.
  • Line 3 - Prints backslash character on the screen.
  • Line 4 - Returns 0.
  • Line 5 - End of main().

See the attachment for output.

Attachments:
Answered by renuahlawat1992
0

Answer:

#include<iostream>

using namespace std;

int main(){

cout<<"\\";

return 0;

}

Similar questions