How to use LINQ to get the top n items from a list in C#? - Biz Tech

How to use LINQ to get the top n items from a list in C#?

Listen
 List<int> numbers = new List<int> { 1, 5, 2, 7, 3 };
var topNumbers = numbers.OrderByDescending(x => x).Take(2);

foreach (int number in topNumbers)
{
    Console.WriteLine(number);
}