-
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;
}
int main ()
{
int value[] = {11, 12, 13, 15, 17};
int Res[5];
adjacent_difference (value, value + 7, Res);
for (int k = 0; k < 5; k++)
cout << Res[k] <<' ';
return 0;
}
-
- 11 1 1 2 2
- 11 1 1 2
- 1 2 2
- 1 2
- 1
Correct Option: A
In this program, We are calculating the adjacent difference of the given range by using function adjacent_difference.