C# Program to Demonstrate the Example of LINQ Reverse() Method

Hi Hello, What I am going to do in this article I will see in detail about C# Program to Demonstrate the Example of LINQ Reverse() Method. This article is a favorite of everyone and many people are suffering without knowing what the reason is. This article will be very useful for them.

C# Program to Demonstrate the Example of LINQ Reverse() Method

C# Program to Demonstrate the Example of LINQ Reverse() Method

//C# program to demonstrate Linq Reverse() method.

using System;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        int[] numbers = new int[] { 20,50,40,39,43,23,45,17,38};
        
        IEnumerable<int> result = numbers.Reverse();

        Console.WriteLine("Reversed array:");
        foreach (var item in result)
        {
            Console.Write(item + " ");
        }
        Console.WriteLine();
    }
}
Reversed array:
38 17 45 23 43 39 40 50 20
Press any key to continue . . .

Final Words

By knowing clearly about C# Program to Demonstrate the Example of LINQ Reverse() Method through this article. If you have any doubts please leave a comment via the comment box. Thank You.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment