✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
#define main1 main
/** Question C1
What is output of the program?
*/
#include <iostream>
int apply_twice(int v, auto fn){
return fn(fn(v));
}
int main1(int argc, char** argv){
int a = 2;
int b = 12;
auto op = [a, &b](int x){
b -= a - x;
return x + b;
};
std::cout << apply_twice(3, op) + op(2);
return 0;
}
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!