I'm supposed to get it to take an int number and print it out one character at a time(one per line) and no, I'm not allowed to turn it into a String and use getCharAt(int x). I have to do it recursively.
I found a way for a base case that will just print it if it is 0-9.
It'll work in my other cases by diving by 10 till I reach the base case, then taking that number I get in the base case and multiplying it 10 raised to the number of times I had to divide by 10 to get the base case.
225 / 10 = 22;
22/ 10 = 2;
225 - 200 = 25;
25 /10 = 2;
25 - 20 = 5;
However, for cases where I something like
x = n * 10^k + c
0 <=c <= 9, That won't work and I need help figuring out what to do in those cases.
For example, I can't use the above way exactly to work with
It'll only print
and miss the 0s.