Please enable JavaScript to use CodeHS

Want to receive Question of the Day updates? Subscribe Here

AP CSA Question of the Day April 9, 2025

Reference
  1. Incorrect Correct No Answer was selected Invalid Answer

    Given the following method:

    public static int mystery(int n) 
    {
        if (n <= 0) 
        {
            return n;
        }
        return  n % 10 + mystery(n / 10);
    }
    Java

    Including the initial call, how many times will the function be called for mystery(1234)?