✅ 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 = 3;
int b = 17;
auto op = [a, &b](int x){
b -= a - x;
return x + b;
};
std::cout << apply_twice(1, op) + op(6);
return 0;
}
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!