MCQs
Total Questions : 10
Answer: Option D. -> All of the mentioned
Answer: Option D. -> All of the mentioned
Answer: Option D. -> all of the mentioned
Answer: Option C. -> Gen
A generic type, such as Gen, is an abstraction.In C# terminology, a construct such as Gen is called an open constructed type, because the type parameter T (rather than an actual type, such as int) is specified.
Answer: Option C. -> delegates are type safe wrappers for function pointers
Answer: Option C. -> System.Linq
Question 7. For the given set of codes, which query will work according to the set of code?class Program{ static void Main(string[] args) { int[] nums = { 1, -2, 3, 0, -4, 5 }; int len = /*_________________ */ Console.WriteLine("The number of positive values in nums: " + len); Console.ReadLine(); }}
Answer: Option C. -> (from n in nums where n > 0
select n).Count();
Answer: Option B. -> Generic procedures should take at least one type parameter
Answer: Option A. -> Stack
Question 10. Select the output for the given code snippet:class Program { static void Main(string[] args) { int[] nums = { 1, -2, 3, 0, -4, 5 }; var posNums = from n in nums where n % 2 ==0 select n; Console.Write("The positive values in nums: "); foreach (int i in posNums) Console.Write(i + " "); Console.WriteLine(); Console.ReadLine(); } }
Answer: Option C. -> code run successfully and executes output
-2, 0, -4