> C++ help in making a program that would take a four digit number and swap the first number with the last one?

C++ help in making a program that would take a four digit number and swap the first number with the last one?

Posted at: 2014-12-18 
like 1234 would be 4231.

Your source code is here: http://AlgoritmosUrgentes.com/en/cpp.php...

If the number is a 4 digit, positive integer in an integer variable called 'n' you can do the following:

? ? ? ? n = (n % 10)*1000 + ((n/10) % 100)*10 + n/1000;

Convert it to a string, then copy the string into a new string starting with the left and moving to the right.

like 1234 would be 4231.