I don't know why the result is like this? I expected 15 50 5. Could anybody help me understand the result
#include<iostream>
#include<conio.h>
using namespace std;
int f(int &a, int &b)
{
int m = a;
int n = b;
a = a*b;
b = a / b;
return n + m;
}
int main()
{
int x = 10;
int y = 5;
cout << f(x, y) << " " << x << " " << y;
_getch();
return 0;
}
//why is the result like this?