LogiQuest
Back to Functions
12

What will be the output of the program?

#include <iostream>
using namespace std;
int main() {
    int k = 3;
    auto f = [k](int v) { return v * k; };
    k = 100;
    cout << f(2) << endl;
    return 0;
}
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.