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

Incorrect

Marks for this submission: 0/1.

Question 18

Marks: 1

What is the value of the local variable x at the end of main? int x = 5; int main(int argc, char** argv) { int x = x; return 0; }

Choose one answer.

a. undefined

b. 5

c. 3

d. 0

e. code is incorrect

Incorrect

Marks for this submission: 0/1.

Question 19

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. Append the first 10 characters from the string in s2 to the string in s1.

Choose one answer.

a. string_cat( s1, s2, 10 );

b. catstrn( s1, s2, 10 );

c. strncat( s1, s2, 10 );

Incorrect

Marks for this submission: 0/1.

Question 20

Marks: 1

The three ways to return control from a called function to a caller are ________, ________ and ________.

Choose at least one answer.

a. stop

b. forward call

c. encounter the closing right brace of a function

d. return expression

e. return

f. break

g. repeat

h. goto

Partially correct

Marks for this submission: 0.67/1.

Question 21

Marks: 1

Which of the following is a correct comment?

Choose one answer.

a. { Comment }

b. */ Comments */

c. \\

d. /* Comment */

e. ** Comment **

Correct

Marks for this submission: 1/1.

Question 22

Marks: 1

What is the value of x at the end of main? int main(int argc, char** argv) { int x = 50 % -7; return 0; }

Choose one answer.

a. -1

b. 1

c. implementation defined

d. undefined

e. compiler error

Incorrect

Marks for this submission: 0/1.

Question 23

Marks: 1

What header file contains C++ file I/O instructions?

Choose one answer.

a. iostream.h

b. outstream.h

c. file.h

d. infstream.h

e. fstream.h

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