-
What is the output of this program?
#include <iostream>
#include <functional>
#include <numeric>
using namespace std;
int Accumulator (int n, int m)
{
return n - m;
}
int Product (int n, int m)
{
return n + m;
}
int main ()
{
int p = 150;
int Array1[] = {12, 22, 33};
int Array2[] = {11, 12, 13};
cout << inner_product(Array1, Array1 + 3, Array2, p ,Accumulator,
Product);
cout << endl;
return 0;
}
-
- 150
- 12
- 22
- 33
- 47
Correct Option: E
In this program, We are forming the custom function from two ranges by using inner_product function.