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

This topic is 3636 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
What is the result (ratio and remainder) of the euclidean division of 12345 by 10?

##### Share on other sites
[%]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!

##### Share on other sites
thanks, that's perfect

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
14
5. 5

• 14
• 10
• 23
• 9
• 33
• ### Forum Statistics

• Total Topics
632632
• Total Posts
3007541
• ### Who's Online (See full list)

There are no registered users currently online

×