product of a vector c++ code example
Example: c++ product of vector
#include <functional> // multiplies
#include <numeric> // accumulate
// ...
std::vector<int> v {2,3,4};
int result = std::accumulate(v.begin(), v.end(), 1, std::multiplies<int>());