Complete the code to access the first element of the array.
int[] numbers = {1, 2, 3, 4};
int first = numbers[[1]];Arrays in C# start at index 0, so the first element is at index 0.
Complete the code to access the last element of the array using its length.
int[] values = {10, 20, 30, 40, 50};
int last = values[values.Length [1] 1];The last element is at index Length - 1 because indexing starts at 0.
Fix the error in accessing the third element of the array.
string[] fruits = {"apple", "banana", "cherry"};
string third = fruits[[1]];The third element is at index 2 because indexing starts at 0.
Fill both blanks to create an array of squares for numbers 1 to 5.
int[] squares = new int[5]; for (int i = 0; i [1] 4; i++) { squares[i] = (i [2] 1) * (i [2] 1); }
The loop runs while i is less than or equal to 4 (indexes 0 to 4). To get numbers 1 to 5, add 1 to i before squaring.
Fill all three blanks to create a reversed copy of the array.
int[] original = {1, 2, 3, 4};
int[] reversed = new int[original.Length];
for (int [1] = 0; [1] < original.Length; [1]++) {
reversed[[2]] = original[original.Length [3] 1 - [1]];
}Use 'i' as the loop variable. Assign reversed[i] to original at the reversed index calculated by Length - 1 - i.
