[Solved] sum up an array of integers in C# [closed]
It isn’t clear what you want… If you want to sum some numbers so that the sum stops summing when it reaches 1002 you can: List<int> list = new List<int> { 4, 900, 500, 498, 4 }; var lst = list.Skip(2).Take(3); int sum = 0; foreach (int num in lst) { int sum2 = sum … Read more