Problem with my program or MPL?

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;
else if (z >= x && x <= y)
	cout << y << " " << z << " " << x;
else if (y <= z && z >= x)
	cout << x << " " << y << " " << z;
	
}
I would say the main function prints the original number after your function ends.
add << endl; at the end of your function.
yeah, I'm starting to think that too. Anyway, what I got was
3 1 2
123
Last edited on
Topic archived. No new replies allowed.