How to Reverse an Array in C# ?

Your 2020 Plan. Learn 20 minutes a day for 20 days. Online courses from €9.99.

If you need to reverse the values of an array , you could use the Reverse extension method.

How to Reverse an Array in C# ?

For example , assume that the array of integer contains the following values 10, 1, 3, 67 . Below is a sample code snippet that demonstrates how to reverse an array in C# using the reverse extension method.

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
namespace GinktageConsoleApp
    internal class Program
        private static void Main(string[] args)
            int[] InputArray = new int[4] { 10, 1, 3, 67 };
            IEnumerable<int> ReversedArray = InputArray.Reverse();
            foreach(var item in ReversedArray)


Leave a Reply

Your email address will not be published. Required fields are marked *