LogiQuest
Back to Functions
5

What will be the output of the program?

#include <iostream>
using namespace std;

int main() {
    int x = 10;
    auto f = [x]() mutable { x += 5; return x; };
    cout << f() << " " << x << endl;
    return 0;
}
Hard

Discussion (0)

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

Log in to join the discussion.