Answers to questions on arrays
- What is the highest legal index for the following arrays?
- int arr1[4];
3
- double means[12];
11
Remember that indices start at zero and go to one less than the
size (in elements) declared for the array.
- Which of the following identifiers are declared as arrays?
- int i, j[4], k;
Only j is an array.
- 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