[Resolved] Splitting an Integer into parts?
Let's say I have an integer, greater than 10...can be anything valid for int (10, 100, 1000, etc).
I need to split that number and get the last digit (0 in all the examples above)...so:
Code:
int x = 42;
int y = 422;
for x, I need to separate it into 4 and 2, and for y 42 and 2. I want to do this without casting to a string, if possible.
What I have to do is right a program that does multiplication "by hand", so I need to take the last digit, and carry the rest over.
Hope I explained it well enough to follow. Thanks in advance.