Return how many digits a positive number has. 4728 has 4. Dividing by 10 repeatedly gets you there; the number 0 has one digit.
int digits(int n)
Examples
There are also 4 hidden tests you can't see. Solve the problem, not the examples.