Vidyalelo
C# Programming · Q70

LINQ (Language

Programming · C# Programming · question 70

Q70

What will be the output of the following C# code snippet? class Program static void Main(string[] args) int[] nums = 16, 9, 25; var posNums = from n in nums where n > 0 select Math.Sqrt(n); Console.Write("The positive values in nums: "); foreach (int i in posNums) Console.Write(i + " "); Console.WriteLine(); Console.ReadLine();

A.
Code runs successfully prints nothing
B.
Code runs successfully prints required output
Answer
C.
Run time error
D.
Compile time error

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board