Home » C++ Programming » Numbers » Question
  1. What is the output of this program?
    #include <iostream>
    #include <functional>
    #include <numeric>
    using namespace std;
    int Function (int p, int q)
    {
    return p + 2 * q;
    }
    struct ClassN
    {
    int operator()(int p, int q)
    {
    return p + 3 * q;
    }
    } object;
    int main ()
    {
    int num = 110;
    int Array[] = {12, 25, 53};
    cout << accumulate(Array, Array + 3, num);
    cout << endl;
    }
    1. 110
    2. 12
    3. 25
    4. 53
    5. 200
Correct Option: E

In this program, We are calculating the product of every number in the given range by using accumulate function.



Your comments will be displayed only after manual approval.