132k views
1 vote
Write a single output statement that outputs the following three lines:

He said, "How is that possible?"
She replied, "Using manipulators."
"Of course!" he exclaimed.

User RTOSkit
by
8.0k points

1 Answer

4 votes

Final answer:

To output the given three lines in a single output statement in C++, you can use the 'cout' statement.

Step-by-step explanation:

To output the given three lines in a single output statement, you can use the cout statement in the C++ programming language. Here is an example:

#include <iostream>

using namespace std;

int main() {

cout << "He said, \"How is that possible?\"" << endl;

cout << "She replied, \"Using manipulators.\"" << endl;

cout << "\"Of course!\" he exclaimed." << endl;

return 0;

}

This code uses the cout object to output each line of text. The << operator is used to concatenate the strings and the << endl; statement is used to insert a newline character after each line.

User Derekaug
by
8.4k points