Multiple Choice Array

 

Multiple Choice Questions

Question 1

Which of the following is the correct usage?

  1. int a[-40]
  2. int a[40]
  3. float a[0 - 40]
  4. None

Question 2

Which element is represented by a[10]?

  1. 10th
  2. 9th
  3. 11th
  4. None

Question 3

Cell numbers of a dimensional array are also known as:

  1. packets
  2. blocks
  3. subscripts
  4. compartments

Question 4

A dimensional array is also known as:

  1. subscripted variable
  2. actual variable
  3. compound variable
  4. none

Question 5

An array element can be accessed through:

  1. dots
  2. element name
  3. index number
  4. none

Question 6

Indicate the error message which displays, if the following statement is executed :
int a[5] = {28,32,45,68,12};

  1. Insufficient cells
  2. Array index out of bounds
  3. Elements exceeding cells
  4. None

Question 7

The following statement :
int code[ ]= {25,37,38,42};

  1. assigns 37 to code[1]
  2. assigns 25 to code[1]
  3. assigns 38 to code[3]
  4. assigns 42 to code[0]

Question 8

The elements of array[50] are numbered:

  1. from 1 to 50
  2. from 0 to 49
  3. from 1 to 51
  4. none

Question 9

Which of the following function finds the size of array
char m[] = {'R', 'A', 'J', 'E', 'N', 'D', 'R', 'A' };?

  1. m.sizeof (a)
  2. m.elementsof (m)
  3. m.length
  4. None

Question 10

A Single Dimensional array contains N elements. What will be the last subscript?

  1. N-1
  2. N
  3. N+1
  4. None

No comments:

Post a Comment