Страница: (Назад) 1 2 3 4 5 6 7 8 9 10 (Далее)
Question31
Баллов: 1
What is the output of the program?
#include <iostream>
using namespace std;
int main() {
int a=3, b=5;
int * c = &a;
c = &b;
*c = 10;
cout << a << " " << b;
return 0;
}
Выберите один ответ.
| a. 3 5 | ||
| b. None of the given choices. | ||
| c. 10 10 | ||
| d. 10 5 | ||
| e. 3 10 |
Question32
Баллов: 1
What does the program below output?
#include<iostream>
usingnamespace std;
int main() {
int a[6] = {3,5,1,6,8,2};
int result = 0;
for (int i=0; i<6; i++)
result += a[i];
cout << result << endl;
return 0;
}
Выберите один ответ.
| a. 1440 | ||
| b. 1 | ||
| c. 8 | ||
| d. 25 | ||
| e. None of the given choices. |
Question33
Баллов: 1
Print the message "This is a C++ program" on one line:
Выберите один ответ.
| a. std::cout >> "This is a C++ program\n"; | ||
| b. std::cout << "This is a C++ \t\nprogram\n"; | ||
| c. std::cin << "This is a C++ program\n"; | ||
| d. std::cout << "This is a C++ program\n"; | ||
| e. std::cout << "This \nis \na C++ pr\nogram\n"; |
Question34
Баллов: 1
Declare a pointer nPtr that points to a variable of type double
Выберите один ответ.
| a. double *nPtr; | ||
| b. double nPtr; | ||
| c. double &nPtr; |
Question35
Баллов: 1
Which of the following is evaluated first?
Выберите один ответ.
| a. I don t know | ||
| b. || | ||
| c. && | ||
| d. Depends | ||
| e.! |
Question36
Баллов: 1
A function is invoked with a
________.
Выберите один ответ.
| a. prototype | ||
| b. int main() | ||
| c. function name | ||
| d. function call |
Question37
Баллов: 1
Output the address in variable integerPtr of type int *.
Выберите один ответ.
| a. cout << * integerPtr; | ||
| b. cout << integerPtr; | ||
| c. cout << &integerPtr; |
Question38
Баллов: 1
Print the message "This is a C++ program" with each word separated from the next by a tab:
Question39
Баллов: 1
If a member initializer is not provided for a member object of a class, the object's __________ is called
Выберите один ответ.
| a. initializer | ||
| b. constructor | ||
| c. creator | ||
| d. default constructor |






