How can I do this recursively?
For homework i need to fill an array using the digits of a natural number. For example if i had the number 32617 my array needs to be a[0]=3, a[1]=2, a[2]=6, a[3]=1, a[4]=7. I have no idea how to do this recursively. The only thing i thought of is how to isolate the numbers. If i had that same number i would divide it by 10 to the power of n-1. n being the number of digits the natural number has. Then i would take the original number and subtract the isolated number and multiply it by 10 to the power of n-1 to get the original number but without the first digit and then repeat until i have one number. The things is i don't know if my logic is correct, or if there is a way to apply it recursively. If someone can help in anyway it would be much appreciated.