Question PRG-CPP-0013
MediumWhat is the output of this program?
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
int main() {
vector<int> v = {1, 2, 3};
cout << accumulate(v.begin(), v.end(), 0);
return 0;
}
- A.
6
- B.
9
- C.
Sign up free to see the answer and a step-by-step explanation.