Examveda

What will be the output of the following C# code snippet?
class Program
{
    static void Main(string[] args)
    {
        int[] nums = { 1 };
        var posNums = from n in nums
                      select Math.Pow(4 ,3);
        Console.Write("The values in nums: ");
        foreach (int i in posNums) 
        Console.Write(i + " ");
        Console.WriteLine();
        Console.ReadLine();
    }
}

A. Run time error

B. 64

C. Compile time error

D. 81

Answer: Option B


This Question Belongs to C Sharp Programming >> Miscellaneous In C Sharp

Join The Discussion

Related Questions on Miscellaneous in C Sharp