Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
asda.docx
Скачиваний:
9
Добавлен:
25.02.2016
Размер:
528.33 Кб
Скачать

Int main() {

int *x = newint[10];

for (int i=0; i<10; i++)

x[i] = i+5;

int *y = x;

y++;

y++;

cout << *y << endl;

return 0;

}

Выберите один ответ.

a. None of the given answers.

b. 7

c. 6

d. 8

e. address of x[2]

Question64

Баллов: 1

What keyword covers unhandled possibilities?

Выберите один ответ.

a. other

b. contingency

c. else

d. all

e. default

Question65

Баллов: 1

What can be at output ? #include <iostream> using namespace std; int main(){ int a = 5;  a = *&*&*&*&a; cout << *&*&*&*&a << " "; cout << &*&*&*&a << " "; return 0; }

Выберите один ответ.

a. 6 0x22ff78

b. 5 0x22ff74

c. 7 0x22ff82

d. 0x22ff74 5

Question66

Баллов: 1

Find the error(s) in the following code segment:  for ( y = .1; y != 1.0; y += .1 ) cout << y << endl;

Выберите один ответ.

a. for ( y = 1; y != 10; y +=1 ) cout << y / 10 << endl;

b. for ( y = 1; y != 10; y++ ) cout << ( static_cast< double >( y ) / 10 ) << endl;

c. for ( y = 0.1; y != 1.0; y += 0.1 ) cout << y << endl;

Question67

Баллов: 1

What gets printed?

#include <iostream>

struct Car { Car() : price(20000) {} Car(double b) : price(b*1.1) {} double price; };

struct Toyota : public virtual Car { Toyota(double b) : Car(b) {} };

struct Prius : public Toyota { Prius(double b) : Toyota(b) {} };

int main(int argc, char** argv) { Prius p(30000);

std::cout << p.price << std::endl;

return 0; }

Выберите один ответ.

a. 20000

b. 22000

c. code is ill-formed

d. 33000

e. 30000

Question68

Баллов: 1

Write a single statement that performs the specified task. Assume that floating-point variables number1 and number2 have been declared and that number1 has been initialized to 7.3. Assume that variable ptr is of type char *. Assume that arrays s1 and s2 are each 100-element char arrays that are initialized with string literals. Print the address of number1.

Выберите один ответ.

a. cout << "The address of number1 is " << &number1 << endl;

b. cout << "The address of number1 is " << *number1 << endl;

c. cout << "The address of number1 is " << address(number1) << endl;

d. cout << "The address of number1 is " << number1.address << endl;

Question69

Баллов: 1

The ________ enables access to a global variable with the same name as a variable in the current scope

Выберите один ответ.

a. unary scope resolution operator ( :: )

b. name

c. register

d. local

e. var

Question70

Баллов: 1

The ostream member function put outputs the specified number of characters

Ответ:

TrueFalse

 

Страница:  (Назад)  1  2  3  4  5  6  7  8  9  10  (Далее) 

 

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]