Question: Consider the following method: For each of the following calls, indicate the value that is returned: a. mystery(3, 3) b. mystery(5, 3) c. mystery(2, 6)
Consider the following method:

For each of the following calls, indicate the value that is returned:
a. mystery(3, 3)
b. mystery(5, 3)
c. mystery(2, 6)
d. mystery(12, 18)
e. mystery(30, 75)
public static int mystery (int x, int y) { while (x != 0 && y != 0) { if (x < y) { y -= x; } else { -= yi return x + y;
Step by Step Solution
3.57 Rating (178 Votes )
There are 3 Steps involved in it
Output of mystery calls ... View full answer
Get step-by-step solutions from verified subject matter experts
