FIND THE ANSWERS

how to reverse 12345 in c++?

Answer this question

  • how to reverse 12345 in c++?


Answers

Answer #1 | 13/02 2014 02:50
n=12345; int s=0; while(n>0) { int k=n%10; s=s*10+k; n=n/10; } cout<< s; i hope you understand the steps..just taking out the last digit and and adding it to a new variable with multiplication. Hope this helps..
Positive: 100 %

Possible answer