Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
c__test.docx
Скачиваний:
30
Добавлен:
25.02.2016
Размер:
2.09 Mб
Скачать
  1. Find the error.

a)it isn’t error

b)main function is incorrect

c)array is incorrect

d)loop for is incorrect

e)output is incorrect

  1. Which of the following is true?

a)not included library of string

b)output is incorrect

c)array isn’t data type of string

d)output is incorrect

e)it is correct

  1. Find the error.

a)it isn’t error

b) n isn’t constant number

c)array incorrect initialized

d)output is incorrect

e)function main is incorrect

  1. Which of the following is true?

a)an array can store many different types of values.

b)an array index should normally be of data type float

c)an array can change the length

d)an initializer list contains more initializers than there are elements in the array

e)the elements of an array are related by the fact that they have the same name and type

  1. What will be the output?

a)0

b)8

c)7.9

d)8.9

e)5.8

  1. Function swap()

a)Means to pass the reference of an argument in the calling function to the corresponding formal parameter of the called function.

b)method of passing arguments to a function copies the reference of an argument into the formal parameter.

c)exchanges the values of the two integer variables pointed to by its arguments.

d)argument reference is passed to the functions just like any other value.

e)all of above

  1. Given the following function declaration and local variable declarations, which of the following is not a correct function call?

a) int myInt;

b) double myDouble;

c) char ch;

d) void someFunction(int& first, double second, char third);

e) all of above

  1. A value-returning function can be used ____.

a) in an assignment statement

b) in an output statement

c) as a parameter in a function call

d) none of them

e) all of the above

  1. Every recursion should have the following characteristics.

a)A simple base case which we have a solution for and a return value. Sometimes there is more than one base case.

b)A way of getting our problem closer to the base case. I.e. a way to chop out part of the problem to get a somewhat simpler problem.

c)A recursive call which passes the simpler problem back into the function.

d)All of them

e)None of them

  1. What is the output of this program?

a) 9

b) 10

c) error

d) 11

e)12

  1. What is the output of this program?

a)In swap 105 In main 105

b) In swap 105 In main 510

c) In swap 510 In main 105

d) In swap 501 In main 105

e) None of the mentioned

  1. What is the output of this program?

a)1468

b) 2812

c) 2614

d)2693

e) none of the mentioned

  1. What error would the following function five on compilation?

a)Missing parentheses in return statement

b)Redeclaration of a

c)Declaration of b

d)No error

e)Function should be define as int f(int a, int b)

  1. It is necessary to declare the type of a function in the calling program if the function

a)Returns an integer

b)Returns a non-integer value

c)Is not defined in the same file

d)Return nothing

e)None of these

  1. What will be the value returned by the following function, when it is called with a value 11?

a)Function does not return any value, because it goes into an infinite loop

b)1011

c)11

d)1010

e)None of these

  1. A function can make

a)One throw

b)One throw of each programmer defined type

c)One throw of each scale type

d)As many throws of as many types as necessary

e)None of them

  1. Empty parameter lists

a)void or leave parameter list empty

b)Indicates function takes no arguments

c)Function print takes no arguments and returns no value

d)All of them

e)None of them

  1. The default parameter passing mechanism is

a)Call by value

b)Call by reference

c)Call by value result

d)Call by parameter

e)None of above

  1. Use of functions

a)Helps to avoid repeating a set of statements many times

b)Enhances the logical clarity or the program

c)Helps to avoid repeated programming across programs

d)None of above

e)All of the above

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