0

How do i reverse 312 to 213

25th Sep 2017, 7:35 PM
prince bortier
prince bortier - avatar
7 Réponses
+ 2
with a for or while loop which in a new string save reverse number by each digit
25th Sep 2017, 7:37 PM
Daniel
Daniel - avatar
+ 2
Without using a container, you can simply do this loop : 1) initialize the result as 0 2) multiply your result then add the unity digit of your number to it 3) divide the number by ten (not the result) 4) if the number is 0, then its done, else go back to 2)
25th Sep 2017, 9:45 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 1
thanks guys
25th Sep 2017, 8:04 PM
prince bortier
prince bortier - avatar
0
NB:answer should be in human language
25th Sep 2017, 7:35 PM
prince bortier
prince bortier - avatar
0
can u please explain a little
25th Sep 2017, 7:37 PM
prince bortier
prince bortier - avatar
0
https://code.sololearn.com/cWZ54cIQDUjV/?ref=app Hope this helps. Try converting this to C++, I suck at C++.
26th Sep 2017, 3:02 AM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar