A

Admin • 828.03K Points
Coach

Q. What will be the output?

Code:
var nums = new int[]{1,2,3,4};
var result = nums.Where(n => n % 2 == 0).Count();
Console.WriteLine(result);
  • (A) 1
  • (B) 2
  • (C) 3
  • (D) 4

Explanation by: Admin
Even numbers are 2 and 4, so count is 2.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.