non mutating algorithm Question 10

Last Updated :
Discuss
Comments

What is the output of the below program?

C++
#include <bits/stdc++.h>
using namespace std;
int main()
{
    vector<int> v = {5, 10, 15};
    int res = accumulate(v.begin(), v.end(), 0, [](int a, int b) { return a * b; });
    cout << res;
    return 0;
}


750

0

30

Compiler error

Share your thoughts in the comments