Vidyalelo
C# Programming · Q59

LINQ (Language

Programming · C# Programming · question 59

Q59

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 wheres n > 0 select Math.Max(78, 9); Console.Write("The largest values in nums: "); foreach (int i in posNums) Console.Write(i + " "); Console.WriteLine(); Console.ReadLine();

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

Answer: Option C

Solution

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