do you know what a logarithm is?
what if i enter 12584585 now this won't work hmmm
yes i know but what if user enter 845769
now it will return 9
but i want it to return 6
Modulo is not what you want. Modulo by 10 just gives you the last digit.
It's a simple pattern here: Dividing by 10 chops off a digit. So just count how many digits you have to shop off until you get them all.
It'll involve a loop.
Last edited on
give me a example of code please