Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Preparation for Final Exam MCQ Quiz BIG.docx
Скачиваний:
16
Добавлен:
25.02.2016
Размер:
50 Кб
Скачать
☆

Int main(int argc, char** argv)

{

int x = x;

return 0;

}

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

b. 0

c. 5

d. undefined

e. code is incorrect

Question 92

Баллов: 1

What is the return type of the function with prototype: "int func(char x, float v, double t);"

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

b. float

c. char

d. double

e. int

Question 93

Баллов: 1

Find the error(s) in the following and correct it (them).

Assume the following prototype is declared in class Employee:

int Employee( const char *, const char * );

Выберите один ответ. a. Employee( const char *, const char * );

b. int Employee( const char *, const char * );

c. Employee( const char , const char );

Question 94

Баллов: 1

Which of the following is a properly defined struct?

Выберите один ответ. a. struct a_struct {int a;};

b. struc a_string{int a;};

c. struct a_struct int a;

d. struct {int a;}

e. struct a_struct {int a;}

Question 95

Баллов: 1

Write one or more statements that perform the following task for and array called “fractions”. Print array elements 6 and 9 with two digits of precision to the right of the decimal point.

Выберите один ответ. a. cout << fixed << setprecision ( 2 ); cout << fractions[ 6 ] < < ' ' fractions[ 9 ] << endl;

b. cout << fractions[ 6 ] < < ' ' fractions[ 9 ] << endl;

c. cout << fixed; cout << fractions[ 6 ] < < fractions[ 9 ] << endl;

d. no ideas

Question 96

Баллов: 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;

}

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

b. 9 1

c. 8 0

d. 8 1

Question 97

Баллов: 1

The keyword is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters

Question 98

Баллов: 1

What output will be produced by the following code?

int n = 1;

do

cout << n << " ";

while (n++ <= 3);

Выберите один ответ. a. 1 2 3 4

b. 2 3 4

c. 1 2 3

d. 1 2 3 4 5

e. 2 3

Question 99

Баллов: 1

What will be output ?

#include <iostream>

using namespace std;

Int main() {

int x = 19;

if (x == 19){

int y = 20;

cout << x+y << endl;

}

y = 100;

return 0;

}

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

b. Compile-time error

c. 38

d. 40

Question 100

Баллов: 1

What value gets printed by the program?

#include <iostream>

int foo(int y);

int foo(int x)

{

return x+1;

}

Int main(int argc, char** argv)

{

int x = 3;

int y = 6;

std::cout << foo(x) << std::endl;

return 0;

}

Выберите один ответ. a. ill-formed

b. 9

c. 3

d. 4

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

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