.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Collections.Generic;
using System.Net;
using System.Net.NetworkInformation;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
using System.Text.RegularExpressions;
using System.Linq;

public class Program
{
	private static List<IPStatus> _results;
	public static async Task MyMethodAsync(IPAddress ip)
	{
		await Task.Delay(500);
		Console.WriteLine("processing");
	}

	public static async Task Asd()
	{
		var options = new ExecutionDataflowBlockOptions{MaxDegreeOfParallelism = 2};
		var block = new ActionBlock<IPAddress>(ip => MyMethodAsync(ip), options);
		var list = new List<IPAddress>{IPAddress.Loopback, IPAddress.Loopback, IPAddress.Loopback, IPAddress.Loopback, IPAddress.Loopback, IPAddress.Loopback, IPAddress.Loopback, IPAddress.Loopback, IPAddress.Loopback};
		foreach (var ip in list)
		{
			block.Post(ip);
		}

		block.Complete();
		await block.Completion;
	}

	public static void Main()
	{
		 double[] array = new double[5] {12.1, 5.9, 2.9, 6.8, 20.5};
		
		Console.WriteLine("Enter input:");              // Prompt
            string input = Console.ReadLine();       
		int highestNums = Convert.ToInt32(input);
		
		var topThree = array.OrderByDescending(i => i)
                    .Take(highestNums);
		foreach (var x in topThree)
        {
            Console.WriteLine(x);
        }
	}
		
}
;