1)What, if anything, prints when each of the following C++ statements is performed? If nothing prints, then answer "nothing". Assume x = 2 and y = 3.
a) cout << x;
b) cout << x + x;
c) cout << "x=";
d) cout << "x = " << x;
e) cout << x + y << " = " << y + x;
f) z = x + y;
g) cin >> x >> y;
h) // cout << "x + y = " << x + y"
i) cout << "\n";
EDIT:
2) Which of the following C++ statements contain variables whose values are replaced?
a) cin >> b >> c >> d >> e >> f;
b) p = i + j + k + 7;
c) cout << "variables whose values are destroyed";
d) cout << "a = 5";
a) Should print the value of x. We know what x is, so what do you think it should print?
b) Should print the value of x+x. And we know what this is.
c) This prints the word/words/wordy-thing "x=".
d) This prints the word/words/wordy-thing "x = " and then the value of x. And what's x?
e) You should be getting the hang of this by now. cout << firstthing << secondthing << etc prints firstthing, then secondthing, then etc.
f) Does setting variables to other expressions print anything to the screen?
g) This lets the user enter their value for x followed by a space, tab, enter, or any combination of those, and then their value for y. Does this print anything?
h) Think about what the purpose of a comment is.
i) \n is basically what you type instead of an enter in strings in C++ (and C and Java and C# and Ruby and Objective C and Python and Perl and Smalltalk(?) and ...)