What does retun answer do?

I'm new to c++ and watching tutorials and I want to know what does return answer do in this code do exactly? The code runs normals even if i skip it. Please can someone explain what return answer does here, please explain it like you would to a child.

#include <iostream>

using namespace std;

int addnumbers(int x, int y){
int answer = x + y;
return answer; // what does return answer do?
}

int main()
{
cout << addnumbers(43, 86);

return 0;
}
what does return answer do?
It copies/moves the content of the local variable to a variable that the caller provides.

In case of

cout << addnumbers(43, 86);

a temporary variable will be generated that is used as the parameter for the operator<<
Topic archived. No new replies allowed.