Question PRG-CPP-0049
MediumWhat is the output of this program?
#include <iostream>
using namespace std;
int main() {
int x = 10;
auto f = [&x]() { x *= 2; };
f(); f();
cout << x;
return 0;
}
- A.
40
- B.
20
- C.
Sign up free to see the answer and a step-by-step explanation.