81.4k views
2 votes
Given the following declarations:

const string PART1 = "Pro";
const string PART2 = "gramming and ";
const string PART3 = "blem Solving with C++";
Write an output statement that prints the title of the textbook for this course using only the cout stream, the stream insertion operator (<<) and the above-mentioned constants.

User Xzyfer
by
8.2k points

1 Answer

0 votes

Final answer:

To print the textbook title using constants and cout in C++, concatenate the strings with the stream insertion operator: cout << PART1 << PART2 << PART3 << endl;.

Step-by-step explanation:

The question asks for a C++ output statement using the cout stream and the provided string constants to print the title of the textbook. The appropriate C++ code using the stream insertion operator (<<) would be:

cout << PART1 << PART2 << PART3 << endl;

This line of code will result in the concatenation and output of the string constants to print out the title "Programming and Problem Solving with C++".

User GOstrowsky
by
7.9k points