using System;
using System.Linq;
namespace ConsoleApplication_C_Sharp
{
class Program
{
static void Main(string[] args)
{
int[] arr = { 1, 2, 3, 4, 5, 6 };
int total = arr.Aggregate((x, y) => y * x);
// 1 * 2 = 2
// 2 * 3 = 6
// 6 * 4 = 24
// 24 * 5 = 120
// 120 * 6 = 720
Console.WriteLine(total);
}
}
}
/*
run:
720
*/