using System;
using System.Linq;
class Program
{
static void Main() {
var arr = new int[] { 1, 2, 3, 4, 5, 6 };
Func<int, int> add1 = x => x + 1;
Func<int, int> square = x => x * x;
var result = arr.Select(add1).Select(square);
foreach (var r in result) {
Console.WriteLine(r);
}
}
}
/*
run:
4
9
16
25
36
49
*/