In C++, we can quickly find array product using accumulate() and multiplies().
product of vector
We can also use a custom function in accumulate. Refer numeric header in C++ STL | Set 1 (accumulate() and partial_product()) for details.
- Number of subsets with product less than k
- Find four factors of N with maximum product and sum equal to N
- Maximum product of an increasing subsequence of size 3
- Generate original array from an array that store the counts of greater elements on right
- array::front() and array::back() in C++ STL
- Sorting an array according to another array using pair in STL
- array::cbegin() and array::cend() in C++ STL
- Array with GCD of any of its subset belongs to the given array
- array::rbegin() and array::rend() in C++ STL
- array::fill() and array::swap() in C++ STL
- array::crbegin() and array::crend() in C++ STL
- What’s difference between “array” and “&array” for “int array” ?
- array::begin() and array::end() in C++ STL
- Closest greater element for every array element from another array
- array::at() in C++ STL
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.