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

Incorrect

Marks for this submission: 0/1.

Question 36

Marks: 1

The possible scopes of an identifier are

Choose at least one answer.

a. global scope

b. namespace scope

c. function scope

d. local scope

e. file scope

f. block scope

g. record scope

h. register scope

i. class scope

j. main function scope

k. auto scope

l. function-prototype scope

Partially correct

Marks for this submission: 0.33/1.

Question 37

Marks: 1

What is the index number of the last element of an array with 29 elements?

Choose one answer.

a. Programmer-defined

b. 29

c. 30

d. 0

e. 28

Incorrect

Marks for this submission: 0/1.

Question 38

Marks: 1

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

Choose one answer.

a. 0x22ff78

b. 5 0x22ff74

c. 5

d. 6

Incorrect

Marks for this submission: 0/1.

Question 39

Marks: 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.

Choose one answer.

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

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

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

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

Correct

Marks for this submission: 1/1.

Question 40

Marks: 1

What value does foo print out? #include <iostream> const int SIZE = 5; struct tester { void foo() { std::cout << SIZE << std::endl; } enum { SIZE = 3 }; }; int main(int argc, char** argv) { tester t; t.foo(); return 0; }

Choose one answer.

a. undefined

b. code is incorrect

c. 8

d. 3

e. 5

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