Hey, for my MPL assignment I'm supposed to create a function that rotates numbers clockwise. For example, 1 2 3 would rotate into 3 1 2. FYI: I'm unable to see the main function. My output matches MPL's output but I'm also getting an output of 123 after my output.
I'm assuming something is wrong with the main function which must be why it is not accepting my assignments but just to be sure, am I doing this correctly?
My output: 3 1 2123
MPL's output: 3 1 2
1 2 3 4 5 6 7 8 9 10 11 12 13 14
void rotate(int &a, int &b, int &c)
{
int x = a;
int y = b;
int z = c;
if (x <= y && y <= z)
cout << z << " " << x << " " << y;
elseif (z >= x && x <= y)
cout << y << " " << z << " " << x;
elseif (y <= z && z >= x)
cout << x << " " << y << " " << z;
}