c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
Linq

Reverse int c# Linq?

| | Console , Linq

In this example I will show you how to reverse the order of the array element using c# Linq. I stored list of numbers in an integer array in a variable. I need to include namespace System.Linq and used reverse extension method. The result will be element of arrays in the opposite direction.

 Example:

static void Main(string[] args)
        {
            int[] numbers = { 100, 905, 7080, 60, 70 };
            var reverse = numbers.Reverse();
            foreach (var group in reverse)
            {
                Console.WriteLine(" " + group);
            }
            Console.ReadLine();
        } 

Output: