Vidyalelo
C++ Programming · Q46

C++ miscellaneous

Programming · C++ Programming · question 46

Q46

What will be the output of the following C++ code? #include #include #include using namespace std; int myfunction (int x, int y) return x + 2 * y; struct myclass int operator()(int x, int y) return x + 3 * y; myobject; int main () int init = 100; int numbers[] = 10, 20, 30; cout << accumulate(numbers, numbers + 3, init); cout << endl;

A.
100
B.
140
C.
160
Answer
D.
180

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board