Well done!

You have completed Variable Scope and Method Arguments!

Quiz Question 1 of 5

Will the below code compile and run? If not, why not?

using System;

class Program
{
    static void GetName()
    {
        var name = "Mike";
    }

    static void Main(string[] args)
    {
        GetName();
        Console.WriteLine(name);
    }
}

Choose the correct answer below:

Skip Quiz Review Video