Get top 3 salaries from list using LINQ.
Toolliyo Coach
Progressive help: Nudge → Guide → Approach. Full solution stays behind the Solution tab.
Editor is open — no login wall to practice.
| Test | Status | Details |
|---|
Ready — edit the code above and click Run or Submit.
using System;
using System.Linq;
class Program
{
static void Main()
{
int[] salaries = { 45000, 120000, 75000, 98000, 150000, 62000 };
var top3 = salaries.OrderByDescending(s => s).Take(3);
Console.WriteLine(string.Join(", ", top3));
}
}
Prefer Coach (Nudge → Guide → Approach) before revealing. No forced signup.
OrderByDescending + Take(3)—deferred execution until enumeration.
Sign in to save and review your submission history. You can still Run code on the Editor tab as a guest.
Sign in