using System;
class MainClass
{
public static void Main()
{
char[] charArray = {'w', 'e', 'l', 'c', 'o', 'm', 'e'};
Array.Sort(charArray); // sort the elements
Array.Reverse(charArray);
Console.WriteLine("Reversed charArray:");
for (int i = 0; i < charArray.Length; i++)
{
Console.WriteLine("charArray[" + i + "] = " + charArray[i]);
}
}
}
|