reduce c# code example
Example 1: c# array.reduce
var sum = number.Aggregate((x, y) => x + y);
Example 2: array reduce c#
//retorna a soma de todos os itens do array
static int simpleArraySum(int[] ar) {
return ar.Aggregate((acc, x) => acc + x);
}