Question: 7. After execution of the following code, what will be the value of input_value if the value 3 is entered at the keyboard at run
7. After execution of the following code, what will be the value of input_value if the value 3 is entered at the keyboard at run time? ________
cin >> input_value;
if (input_value > 5)
input_value = input_value + 5;
else if (input_value > 2)
input_value = input_value + 10;
else
input_value = input_value + 15;
| a. | A. 8 |
| b. | B. 13 |
| c. | C. 1 |
| d. | D. 0 |
| e. | E. 18 |
8. If you place a semicolon after the statement if (x < y) ______
| a. | The code will not compile. |
| b. | The compiler will interpret the semicolon as a null statement. |
| c. | All of the above. |
| d. | The if statement will always evaluate to false. |
| e. | None of the above
|
9. What will the following code display?
int numbers[] = { 99, 87, 66, 55, 101 };
for (int i = 1; i < 4; i++)
cout << numbers[i] << endl;
| a. | 99 87 66 55 101
| c. |
87 66 55 101
|
| b. | 87 66 55
| d. | Nothing. This code has an error. |
10. _______ A statement that starts with a # is called a:
| a. | Comment |
| b. | Function |
| c. | Preprocessor directive |
| d. | Key word |
| e. | None of the above. |
11. _______ In a C++ program, two slash marks ( // ) indicate:
| a. | The end of a statement |
| b. | The beginning of a comment |
|
|
|
| c. | The end of the program |
| d. | The beginning of a block of code |
| e. | None of the above |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
