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.