-
What is the output of this program?
#include <iostream>
#include <functional>
#include <numeric>
using namespace std;
int myop (int p, int q)
{
return p + q + 1;
}
int main ()
{
int value[] = {11, 12, 13, 14, 15, 16};
int Res[5];
partial_sum (value, value + 5, Res);
for (int k = 0; k < 6; k++)
cout << Res[k] << ' ';
return 0;
}
-
- 11 23 36
- 50 65 0
- 23 36 50
- 11 23 36 50 65 0
- None of these
Correct Option: D
In this program, We are calculating the sum of the given range by using partial_sum function.