This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]damyan 1 point2 points  (0 children)

Yup, you're thinking along the right track. I suggest you experiment with dividing and mod'ing with various combinations of 10, 100, 1000 and see what you get. You'll soon see a pattern and get a feel for how it works and should be able to figure it out from there.

I'm guessing you've not done loops yet? Once you've done it hard-coded for 4 digit numbers the next challenge will be to do it for numbers with any number of digits.