flipping number question: math formula or algorithm

transgalactic

Junior Member
Joined
Nov 20, 2008
Messages
58
what is the math formula(algorithm) for flipping any number like:

47->74

1655 -> 5561

12345->54321

??
 
Re: flipping number question..

Is this for a programming exercise? I don't know of a simple math function that does it, but if this is for programing you need to use modulus (% in C++ and Java) and integer division (/ in Java and C++), and a while loop. The number %10 will give you the last digit. The number /10 will remove the last digit from the number. See if you can figure it out. :)

This thread is also in the wrong section.
 
Top