Consider the following code:
public void mystery(int n) {
if (n < 0) {
System.out.print("-");
mystery(-n);
} else if (n < 10) {
System.out.println(n);
} else {
int two = n % 100;
System.out.print(two / 10);
System.out.print(two % 10);
mystery(n / 100);
}
}
What will be printed by the call mystery(n)?
ANS
The recursive call strips off the rightmost two digits and prints them.
My answer is ANS.