Code:
using System;
public class ReverseArray
{
public string Reverse(params string [] arr)
{
string [] j;
string [] k;
Console.Write("The array list without reversing is : ");
foreach (int i in arr)
{
Console.Write(" "+i);
j = new string[i]; // Save all the contents in the array ''j''
i++;
}
for (int a = 0; a < j.Length ; a ++)
{
k[a] = j[a]; // Saving the array in another array
}
for (int i = 0; i < j.Length ; i++)
{
j[i] = k[k.Length]; // Here we are reversing the array elements
k.Length --;
}
Console.Write("The reversed array now has : ");
foreach (int i in j)
{
Console.Write(" "+j); // Print the elements of the array ''j''
i++;
} } }