Complete the code to declare an array of 5 integers.
int numbers[[1]];The number inside the square brackets specifies the size of the array. Here, 5 means the array can hold 5 integers.
Complete the code to access the third element of the array named 'scores'.
int thirdScore = scores[[1]];Array indexes start at 0, so the third element is at index 2.
Fix the error in the code to correctly initialize an array with values 1 to 4.
int arr[4] = {1, 2, 3, [1];
The array size is 4, so it must have exactly 4 values. The last value should be 4 to match the sequence 1, 2, 3, 4.
Fill both blanks to create an array of 3 floats and assign 2.5 to the first element.
float [1][[2]]; [1][0] = 2.5;
The array is named 'prices' and has size 3. Then we assign 2.5 to the first element at index 0.
Fill all three blanks to declare an array of 4 integers and set the last element to 10.
int [1][[2]]; [1][[3]] = 10;
The array named 'data' has size 4. The last element is at index 3 (since indexing starts at 0), so we assign 10 there.