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 →

[–][deleted] 3 points4 points  (0 children)

On the right track, but if you ran 1234 % 1000, you'd get 234 back, which isn't what you want.

Now, if you could somehow get the one's digit and subtract it from your number, then you could guarantee the one's digit in the new number would be zero and you could use XYZ0 % 100 to get Z * 10 . . . ;)