Let's say we have an array of integers like {234,213,666,879}. The objective is to find the multiplication of these numbers.Below program will do so
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
var intCollection = new List<System.Numerics.BigInteger>() { 234, 213, 666, 879 };
var product = intCollection.Aggregate((a, b) => a * b);
Console.WriteLine("Product is {0}", product);
Console.ReadKey();
}
}
}
Result
---------
Product is 29178204588