Complete the code to sort the array in ascending order.
int[] numbers = {5, 3, 8, 1};
Array.[1](numbers);The Array.Sort method sorts the array elements in ascending order.
Complete the code to reverse the order of elements in the array.
string[] fruits = {"apple", "banana", "cherry"};
Array.[1](fruits);The Array.Reverse method reverses the order of elements in the array.
Fix the error in the code to find the index of the element "dog" in the array.
string[] animals = {"cat", "dog", "bird"};
int index = Array.[1](animals, "dog");The Array.IndexOf method returns the index of the specified element in the array.
Fill both blanks to sort the array and then reverse it.
int[] values = {4, 7, 2, 9};
Array.[1](values);
Array.[2](values);First, Sort arranges the array in ascending order. Then, Reverse flips it to descending order.
Fill all three blanks to find the index of "blue" in the colors array after sorting and reversing it.
string[] colors = {"red", "blue", "green"};
Array.[1](colors);
Array.[2](colors);
int pos = Array.[3](colors, "blue");First, Sort orders the array. Then, Reverse flips it. Finally, IndexOf finds the position of "blue".