Answers for "how to find the sum of a vector c++"

C++
0

how to find the sum of a vector c++

#include <numeric>

 sum_of_elems = std::accumulate(vector.begin(), vector.end(), 0);
Posted by: Guest on April-30-2022

Code answers related to "how to find the sum of a vector c++"

Browse Popular Code Answers by Language