Skip to content

Commit

Permalink
Update palindrome_no.java
Browse files Browse the repository at this point in the history
  • Loading branch information
raksha009 authored Mar 21, 2020
1 parent b9b04ba commit 5ea3c47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Palindrome/palindrome_no.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ public class palindrome_no {
public static int reverse(int number) {
int reverseno = 0 ;

while (number >0) {
reverseno = (int) (reverseno*Math.pow(10, 1) + number%Math.pow(10, 1));
number = (int) (number/Math.pow(10, 1));
while (number > 0) {
reverseno = (int) (reverseno * Math.pow(10, 1) + number % Math.pow(10, 1));
number = (int) (number / Math.pow(10, 1));
}
return reverseno;
}
Expand Down

0 comments on commit 5ea3c47

Please sign in to comment.