Examveda

What will be the output of the following C# code?
public static void Main(string[] args)
{
    p();
    void p()
    {
        Console.WriteLine("hi");
    }
}

A. Compile time error

B. hi

C. hi infinite times

D. None of the mentioned

Answer: Option A


Join The Discussion

Related Questions on Classes and Objects in C Sharp