Multiple Choice Identify the
choice that best completes the statement or answers the question.
|
|
|
1.
|
Which of the following symbols represents the C++ assignment
operator?
|
|
|
2.
|
Which of the following statements could be used in a C++ program to initialize
three variables to the same value in one statement?
a. | i, j, k = 25; | c. | i = j = k = 25; | b. | i j k = 25; | d. | none of the
above |
|
|
|
3.
|
Which term below describes the C++ operators used to perform calculations in a
program?
a. | mathematical | c. | logical | b. | arithmetic | d. | all of the
above |
|
|
|
4.
|
Which C++ operator is used to determine the integer remainder value of a
division operation?
a. | modulus | c. | left | b. | remainder | d. | balance |
|
|
|
5.
|
While most arithmetic operators are always used with two operands, which
operator below can also be used with a single operand?
|
|
|
6.
|
For the expression: x = 13 % 5; What would be the result stored in
x
|
|
|
7.
|
Which statement below could be used in a C++ program to display a message and
the result of a calculation to the user without requiring a variable to store the result?
a. | cout << "Result = x/y" << endl; | c. | cout << "Result = "
<< x/y << endl; | b. | cout << "Result = " x/y
<< endl; | d. | cout
<< "result = x/y endl; << |
|
|
|
8.
|
What will occur to the value in the variable count when the instruction
count++; is executed?
a. | the value will be increased by one | c. | the value will have its sign
changed | b. | the value will be doubled | d. | the value will be raised to a power of 2 |
|
|
|
9.
|
Which of the following items has the highest order of operations?
a. | multiplication | c. | addition | b. | division | d. | negation |
|