Complete the code to declare an array of 5 integers.
int numbers[[1]];The number inside the 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 'data'.
int value = data[1];Array indexing starts at 0, so the third element is at index 2.
Fix the error in the code to correctly initialize an array with values 1, 2, 3.
int arr[3] = [1]1, 2, 3[2];
Arrays in C are initialized using curly braces { } around the values.
Fill both blanks to create a loop that prints all elements of an array 'arr' of size 4.
for(int i = 0; i [1] 4; i[2]) { printf("%d\n", arr[i]); }
The loop runs while i is less than 4, and i is incremented by 1 each time using ++.
Fill all three blanks to declare an array 'scores', assign 10 to the first element, and print it.
int scores[3]; scores[1] = [2]; printf("%d", scores[3]);
Arrays use square brackets to access elements. The first element is at index 0. We assign 10 to scores[0] and print scores[0].
