using System;
using System.Linq;
class Program
{
static void Main() {
int[] array = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
var result = array.Aggregate(Enumerable.Empty<double>(), (total, next) =>
total.Append(Math.Pow(next, 2)));
foreach (var val in result) {
Console.Write(val + ", ");
}
}
}
/*
run:
1, 4, 9, 16, 25, 36, 49, 64, 81, 100,
*/