1) This code attempts to find the k-th digit from the right of a number, but it has logical errors that prevent it from working correctly. 2) Hint: The initial value of `n` is 0, so the while loop that counts digits never executes. Also, consider what happens when `k` is larger than the number of digits in `n`.