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

Incorrect

Marks for this submission: 0/1.

Question 9

Marks: 1

What is the output of the program? #include <iostream> using namespace std; int main() { int a = 10; for (a=1; a<81; a*=3) cout << a << " "; cout << endl; return 0; }

Choose one answer.

a. 1 3 9 27 81

b. 1 3 6 9 12

c. 1 3 27 81

d. 10 30

e. 1 3 9 27

Incorrect

Marks for this submission: 0/1.

Question 10

Marks: 1

What will be output? #include <iostream> using namespace std; void function1(int *a){ cout << *(a + 1) << " " << *(a + 9); } int main() { int arr[] = {9,8,7,6,5,4,3,2,1,0}; function1(arr); return 0; }

Choose one answer.

a. 9 1

b. 8 1

c. 8 0

d. 9 2

Incorrect

Marks for this submission: 0/1.

Question 11

Marks: 1

If there are fewer initializers in an initializer list than the number of elements in the array, the remaining elements are initialized to the last value in the initializer list

Choose one answer.

a. false

b. it depends of the type of an array

c. it depends on compilator

d. true

Incorrect

Marks for this submission: 0/1.

Question 12

Marks: 1

The modulus operator (%) can be used only with integer operands.

Answer:

True False

Correct

Marks for this submission: 1/1.

Question 13

Marks: 1

Why would you want to use inline functions?

Choose one answer.

a. To decrease the size of the resulting program

b. To remove unnecessary functions

c. To make your code more clear

d. To increase the speed of the resulting program

e. To simplify the source code file

Correct

Marks for this submission: 1/1.

Question 14

Marks: 1

Find four different C++ statements that each add 1 to integer variable x:

Choose at least one answer.

a. ++x;

b. x += 1;

c. x++;

d. x += x + 1;

e. x == x + 1;

f. x =+ 1;

g. x = x + 1;

Correct

Marks for this submission: 1/1.

Question 15

Marks: 1

Find the error in the following program segment: int sum( int x, int y ) { int result; result = x + y; }

Choose one answer.

a. not sure

b. int sum( int x, int y ) { return x + y; }

c. result sum( int x, int y ) { int result; result = x + y; }

d. int sum( int x, int y ) { result x + y; }

e. all variants are correct

Correct

Marks for this submission: 1/1.

Question 16

Marks: 1

What is the output of the program?

#include <iostream> using namespace std; int main() { for (int a=10; a<91; a*=3) cout << a << " "; cout << endl; return 0; }

Choose one answer.

a. 10 30 90 270

b. 10 11 12 ... 90

c. 10 30

d. 10 30 90

e. 1 2 3 ... 90

Correct

Marks for this submission: 1/1.

Question 17

Marks: 1

The four objects that correspond to the standard devices on the system include _________, _________, __________ and ___________.

Choose one answer.

a. std.int, std.out, std.err and std.log

b. cin, cout, cerr and clog

c. in, out, err and log

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