What will be the output of the below program?

using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.Write(new List<int>() { 16, 17, 4, 3, 5, 2, 10 }
.OrderBy(o => o)
.SkipWhile(s => s < 2)
.TakeWhile(t => t <= 10)
.ToList()
.Aggregate((a, b) => a + b));
}
}
}

 Posted by Rajnilari2015 on 10/12/2016 | Category: C# Interview questions | Views: 505 | Points: 40
Select from following answers:
  1. 24
  2. 42
  3. 12
  4. 21
  5. All Above

Show Correct Answer


| Alert Moderator 

Comments or Responses

Login to post response