cs509:cpluspluscout1
Which of the following C++ statements will print the following lines to the screen, assuming int x = 2 and int y = -2:
The sum of x and y is 0. The remainder of x divided by y is 0.
a) cout << "The sum of x and y is " << x + y << "." << endl
<< "The remainder of x divided by y is " << x % y << ".";
b) cout << "The sum of x and y is " << x + y << ". "
<< "The remainder of x divided by y is " << x / y + 1 << ".";
c) cout << "The sum of" x "and" y "is 0." << endl
<< "The remainder of" x "divided by" y "is 0." << endl;
d) cout << "The sum of x and y is 0. The remainder of x divided by y is 0.";
e) cout << "The sum of x and y is " << x + y << "." << "\n" <<
"The remainder of x divided by y is " << x / y - 1 << ".";
<poll Choose one (1)>
- a
- b
- c
- d
- e
</poll>
cs509/cpluspluscout1.txt · Last modified: by jchung
