Answers to questions on arrays

  1. What is the highest legal index for the following arrays?
    1. int arr1[4];
      3

    2. double means[12];
      11

    Remember that indices start at zero and go to one less than the size (in elements) declared for the array.

  2. Which of the following identifiers are declared as arrays?
    1. int i, j[4], k;
      Only j is an array.

    2. float r[3],s[2],t,u[7];
      r,s and u are all arrays, t is a simple float.

Back to the questions


Back to notes on arrays