The return value is 17.
Did you explicitly show the output value? It's easy to lose points on exams by not following instructions like this one.
If your table had a lot more steps, were you subtracting off the smaller number rather than taking the remainder?
Did you start with the numbers in the order given, i.e. so the first iteration swaps the values of x and y?
The last line is technically necessary, because the main variables are reset before the loop halts. If a picky person is grading your solution, they might take off points for not including it.