How will you print \ in c++?
Answers
Answered by
4
Solution:
To print backslash '\' character in C++, write the code given below.
#include <iostream>
int main() {
std::cout<<"\\";
return 0;
}
Explanation:
- Line 1 - Instructs the preprocessor to include a section of standard C++ code , 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
0
Answer:
#include<iostream>
using namespace std;
int main(){
cout<<"\\";
return 0;
}
Similar questions