Using Aggregate Function on Arrays in C#

If you have got an array of integers and you want to multiple the values inside the array and display its value without using for loop , here’s one of the ways to achieve it using the LINQ and Lambda expression .

Assuming the array of integer has the following values

int[] marks = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

You can multiply each of the values inside the integer array without using any for loop or foreach with the below code.