[java] reading digits from an int one at a time

Started by
2 comments, last by hughiecoles 15 years, 6 months ago
I have an assignment where i have to take each digit from a zip code, and translate them into a graphical code, any suggestions on where to start
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried
Advertisement
What is the result (ratio and remainder) of the euclidean division of 12345 by 10?
[%]mod operator returns the remainder

you can do something like this.
For example if you have a no. say 123, then 123 % 10,
steps:1. 123%10 -> you get 3now quotient 12,2. 12%10  -> you get 2now quotient 13. 1%10   -> you get 1


Then you can get each digits of the number.

Cheers!
thanks, that's perfect
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried

This topic is closed to new replies.

Advertisement