LinQ - foreach statement

Saratvaddilli
Posted by Saratvaddilli under LINQ category on | Points: 40 | Views : 1840
class Program
{
static void Main(string[] args)
{
List<int> intlist = new List<int>();
intlist .Add(10);
intlist .Add(20);
intlist .Add(30);
intlist .Add(40);
intlist .Add(50);

(from l in intlist where l > 10 select l).ToList().ForEach(i => Console.WriteLine(i * i));

Console.Read();
}
}

Comments or Responses

Login to post response