Does anyone know a good method to work on the digits of an int separately without using an array?
For instance, if the number was 1234, I need to be able to multiply every other number by 2 and then add them together. ( 1 + (2*2) + 3 + (4*4) ). So I need to be able to isolate the 4 off the end, multiply it, and then isolate the 2 and multiply it...
Obviously if each of the digits were stored in an array it wouldn't be too hard, but this cant be done using arrays. Any ideas?
Without using an array? Off the top of my head divide the number given to you by thousands then hundreds then tens and finally ones. Put each digit in it's own integer then do your manipulations and multiply them by what ever you divided them by in the beggining. This sounds like an excersize in masochism to me but to each their own.