What will be the output of the following code snippet?

    class Program
    {
        private static string result;

        static async Task<string> GreetUser()
        {           
            result = "Hello world!";
            await Task.Delay(5);
            return "Hello user!";
        }

        static void Main(string[] args)
        {
            GreetUser();
            Console.WriteLine(result);
        }
    }

Hello world!

Hello user!

Compilation Error - Incorrect usage of 'async' and 'await' keywords

The code executes without displaying any output

Verified Answer
Correct Option - a

To get all Advanced CSharp Programming Assessment Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in