P
Pokey
Hi,
How do you split an integer into individual digits?
E.g. 1234 into 1, 2, 3 and 4.
Thanks,
Ed.
How do you split an integer into individual digits?
E.g. 1234 into 1, 2, 3 and 4.
Thanks,
Ed.
How do you split an integer into individual digits?
E.g. 1234 into 1, 2, 3 and 4.
Roedy said:rest = num / 10;
digit = num % 10;
add a loop.
... but reverse the above:
digit = num % 10;
rest = num / 10;
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.