class ReverseArray
{
static void Main()
{
int[] arrays = { 1, 2, 3, 4, 5, 6 };
int length = arrays.Length;
int[] Reversed = new int[length];
for (int index =
0; index < length; index++)
{
Reversed[length - index - 1] =
arrays[index];
}
for (int index =
0; index < length; index++)
{
Console.Write(Reversed[index] +
" ");
}
Console.ReadLine();
}
}
Output:
No comments:
Post a Comment