in c you hava to access elements and change them using their

in c#


you hava to access elements and change them using their index elements in reversed order.



input:1234

output:54321

Solution

/*
* C# Program to Reverse an Array
*/
using System;
class ArrayReverse
{
static void main()
{
int[] array = { 1, 2, 3,4,5 };
foreach (int a in array)
{
Console.WriteLine(a);
}
Array.Reverse(array);
Console.WriteLine(\"Reversed Array : \");
foreach (int value in array)
{
Console.WriteLine(value);
}
Console.ReadLine();
}
}

Output : 54321

in c# you hava to access elements and change them using their index elements in reversed order. input:1234 output:54321Solution/* * C# Program to Reverse an Arr

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site