C# code for sum using aggregate method

Amatya
Posted by Amatya under C# category on | Points: 40 | Views : 259
C# code for sum using aggregate method

var dnfnum = new List<int> { 10, 20, 30, 40, 50 };
int dnfsum = dnfnum.Aggregate(func: (result, item) => result + item);


Result
dnfsum 150

Comments or Responses

Login to post response