accumulate function in stl to add even number in a vector code example Example: sum of elements in c++ stl accumulate(a.begin(), a.end(), 0)