2.2: Output using cout: 10966

Problem:

Write a single statement that will print the message “first is ” followed by the value of first, and then a space, followed by “second = “, followed by the value of second. Print everything on one line and go to a new line after printing. Assume that first has already been declared as a double and that second has been declared as an int. Assume also that the variables have already been given values.

Solution:

cout << “first is” << first << ” ” << “second =” << second << endl;