While Simulation
Write the output of each statement, given the followingmethod:
public static void mystery(int x) {
int y = 0;
while (x % 2 == 0){
x /= 2;
y++;
}
System.out.println(x + ” ” + y);
}
Statements: (This is where I am stuck, what are theoutputs?
mystery(9);
myster(6);
myster(12);
mystery(8);
myster(16);
Solution
to
OR
OR