Aggregate sum of all elements in array using LINQ

int[] numbers = new int[] {1,2,3,4,5,6,7,8};
 
int result = numbers.Sum();
Console.WriteLine(result);

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.