You can either do it the "cheating" way by converting into a String, looping through and using Character.numericValue(s.charAt(n)), or do it a better way by repeatedly dividing by 10 and looking at the result modulus 10.
Joined: Sep 25, 2010
Luigi, I appreciate your help a lot, do you think you could give a little more of an example for the second option? Like give some code? I'm sorry, I'm just having some trouble following.
You should know by now that that's not how things work here. Please read: NotACodeMill. Are you saying you can't even get started at all? You've already been give two algorithms. Give one of them a try!