What, if anything, prints when each of the following C++ statements is performed? If noth- ing 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";
```

a) 2
b) 4
c) x=
d) x = 2
e) 5 = 5
f) nothing.
g) nothing.
h) nothing (because it is a comment).
i) A newline is output which positions the cursor at the beginning of the next line on the screen.

Computer Science & Information Technology

You might also like to view...

A ________ is a reserved area for text or graphics that display at the top of a document

Fill in the blank(s) with correct word

Computer Science & Information Technology

How can you modify an angle after closing the Multi-Camera Monitor?

What will be an ideal response?

Computer Science & Information Technology