Hey I have a my programming lab question here and I just don't know what's wrong.
This is the question:
Write the definition of a function named maxmin that is passed four int arguments . The function returns nothing but stores the larger of the first two arguments in the third argument it receives and the the smaller of the first two arguments in its fourth argument . So, if you invoke maxmin(3,7,x,y) , upon return x will have the value 7 and y will have the value 3.
#include <iostream>
usingnamespace std;
void maxmin (int, int, int&, int&);
int main ()
{
int a, b, x, y;
cin >> a >> b >> x >> y;
maxmin(a,b,x,y);
cout << a << b << x << y;
}
void maxmin ( int a, int b, int &x, int &y)
{
if (a > b)
{
x = a;
y = b;
}
else
y = a;
x = b;
}