Home / CSE MCQs / C#.Net MCQs :: Discussion

Discussion :: C#.Net MCQs

  1. 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();
        }
    }
  2. A.
    from n in nums where n > 0 select n
    B.
    from n in nums where n > 0 select n.Count()
    C.
    (from n in nums where n > 0 select n).Count();
    D.
    Both b & c

    View Answer

    Workspace

    Answer : Option C

    Explanation :



Be The First To Comment