SyntaxFix
Write A Post
Hire A Developer
Questions
Provided that you can use .NET 3.5 (or newer) and LINQ, try
int sum = arr.Sum();