Check out example codes for "add all elements in a list c#". It will help you in understanding the concepts better.

Code Example 1

using System.Collections.Generic;
using System.Linq;

List<int> intList = new List<int>(){1, 2, 3, 4};
int sum = intList.Aggregate((x, y) => x + y);

Learn ReactJs, React Native from akashmittal.com