+ 2

How to reverse 321 to 123 using while loop ?

21st Sep 2016, 8:51 AM
yash nanda
yash nanda - avatar
3 Respuestas
+ 3
int n,digit,rev=0; //i think u know what will be the process after while(n!=0)// till the n is zero { digit=n%10; rev=rev*10+digit; n=n/10; } so print the reverse number S.o.p("reversed number is "+rev);
21st Sep 2016, 6:23 PM
Pranit Bhoir
Pranit Bhoir - avatar
17th Feb 2017, 2:44 AM
Kommoju Sunil Kumar
Kommoju Sunil Kumar - avatar
0
use palindrome
21st Sep 2016, 2:09 PM
Gokul Menon
Gokul Menon - avatar