PLEASE HELP WITH FOLLOWING CODE

In this code am i getting the correcting answers?

I'm kind of lost with this function

thanks!



thank you!
Last edited on
Other than missing <cmath>, code does give exactly what you expect.
closed account (48T7M4Gy)
1
2
3
4
5
6
7
8
9
10
11
int fn(int x, int &y)
{
cout << "At the moment, x=" << x << endl;
x*=2;
cout << "Now, x=" << x << endl;

y = pow(y,2);
cout << "And y=" << x << endl;

return x-y;
}


Change your function as shown. It might help you undersand what's going on inside the function.
Topic archived. No new replies allowed.