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