#includeiostream  
usingnamespace std;
int main()
{
int x=5;
int y=5;
auto check =[&x]()
{
x =10;
y =10;
}
check();
cout"Value of x: "xendl;
cout"Value of y: "yendl;
return0;
}

Posted on by