Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save supreettare/43a1b3c514e7d82ee8dc002f86612bbe to your computer and use it in GitHub Desktop.

Select an option

Save supreettare/43a1b3c514e7d82ee8dc002f86612bbe to your computer and use it in GitHub Desktop.
What is the output of the program below? Explain your answer.
class Program {
private static string result;
static void Main() {
SaySomething();
Console.WriteLine(result);
}
static async Task<string> SaySomething() {
await Task.Delay(5);
result = "Hello world!";
return “Something”;
}
}
@sajijohn80
Copy link

Hello world!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment