lenelex.com
Home
Quizzes
Games
Register
Log in
Question 1 of 19
What is the output of the following program?
class Program { static void Main() { Task a = RunAsync(time: 6); Task b = RunAsync(time: 2); Task c = RunAsync(time: 4); Task.WaitAll(a, b, c); Console.ReadKey(true); } static public async Task RunAsync(int time) { await Task.Delay(time * 1000); Console.Write($"{time} "); } }
A. 6 4 2
B. 6 2 4
C. 2 4 6
D. 4 2 6
Links:
await
async
Asynchronous programming with async and await