Output Text With Quotation Marks
Make a program that outputs Hello World!, and then outputs the content of the line that is responsible for outputting Hello World!
Requested Output
Hello World!
std::cout << "Hello World!\n";
answer
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
std::cout << "std::cout << \"Hello World!\\n\";";
}
Using
\in front of"and\characters lets us include them in a output without the program thinking that we want them to end the text, or include an escape sequence.