Home » C++ Programming » Numbers » Question
  1. What is the output of this program?
    #include <iostream>
    #include <functional>
    #include <numeric>
    using namespace std;
    int mnewfunction (int n, int m)
    {
    return n + 3 * m;
    }
    struct N
    {
    int operator()(int n, int m)
    {
    return n + 3 * m;
    }
    } structObject;
    int main ()
    {
    int a = 200;
    int Arr[] = {11, 21, 31};
    cout << accumulate (Arr, Arr + 3, a, minus<int>() );
    cout << endl;
    return 0;
    }
    1. 21
    2. 31
    3. 200
    4. 137
    5. None of these
Correct Option: D

In this program, We are finding the difference between the init and the total of numbers range.



Your comments will be displayed only after manual approval.