Example HTML page

DS – mcq on Arrays

11. In C language what would be the maximum limit of dimensions of an array.

  1. 3
  2. 13
  3. 31
  4. Depends on Compiler.

Answer: D

12.A string is similar to an array since ____.

  1. Both are character arrays
  2. Both contains values
  3. Way of accessing functions is same.
  4. A string is a kind of an array.

Answer: D

13. While passing an array as an actual argument ,the function call must have __.

  1. The array name with empty braces.
  2. Array name with its size.
  3. Only array name.
  4. None of the above.

Answer: C

14.Passing a parameter to an array is called ______.

  1. Call by value.
  2. Call by value result.
  3. Call by reference.
  4. None of these.

Answer: A

15.Under which of the following conditions, the size of the array need not be specified?

  1. When initialization is part of definition
  2. When It is a declaration
  3. When it is a formal parameter
  4. All of the above.

Answer: D

16.What does the following declaration represents?

Enum colors {black, blue, green};

  1. Black = -1, blue = 2, green =3
  2. Black = -1, blue = -2, green =3
  3. Black = -1, blue = 0, green =1
  4. Illegal declaration

Answer: C

17. C does no automatic array bound checking. This is __

  1. True
  2. False
  3. C’s Shortcoming
  4. Only (A) and (C).

Answer: D

18.If a two dimensional array is used as a formal parameter, then

  1. Both the subscripts may be left empty
  2. The first subscript may be left empty
  3. The first subscript must be left empty
  4. Both the subscripts must be left empty.

Answer: B

19.Which of the following is/are correct?

  1. During array declaration, no storage is set aside.
  2. Array definition precedes array declaration
  3. Initialization cannot be done during array declaration
  4. All are correct.

Answer: D

20.What is it termed as when more than one script/index is required to reference of all elements in an array?

  1. One dimensional
  2. Multi dimensional
  3. Two dimensional
  4. None

Answer: B

Example HTML page

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest