sum of all the elements of an array using stl code example Example: sum of elements in c++ stl accumulate(a.begin(), a.end(), 0)