Question PRG-CPP-0048
MediumWhat is the output of this program?
#include <iostream>
using namespace std;
int main() {
auto add = [](int a, int b) { return a + b; };
int k = 10;
auto addk = [k](int x) { return x + k; };
k = 100;
cout << add(2, 3) << " " << addk(1);
return 0;
}
- A.
5 11
- B.
5 1
- C.
Sign up free to see the answer and a step-by-step explanation.