A

Admin • 828.03K Points
Coach

Q. What will be the output?

Code:
var nums = new int[]{1,2,3,4};
var sum = nums.Where(x => x > 2).Sum();
Console.WriteLine(sum);
  • (A) 3
  • (B) 4
  • (C) 7
  • (D) 10

Explanation by: Admin
Values greater than 2 are 3 and 4 → sum is 7.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.