0
WAP to reverse a number.
int n, n1, n2, r; n-Integer.parseInt(text1.getText()); n1-n%10; n-n/10; n2-n%10; n-n/10; r-(n1*100)+(n2*10)+n; text2.setText(""+r);
2 Respuestas
+ 1
It's ok for 3 digit numbers. Why don't you post this in the code playground instead?
0
You can just use StringBuilder to reverse string as it shows in the following code:
https://code.sololearn.com/cJfcXRoys18W/?ref=app