diff --git a/isPalindrome.java b/isPalindrome.java new file mode 100644 index 0000000..f3df571 --- /dev/null +++ b/isPalindrome.java @@ -0,0 +1,23 @@ +class Solution { + public boolean isPalindrome(int x) { + + int r =0; + int z =x; + if(x>=0){ + while(x!=0){ + + int remi = x%10; + x=x/10; + r=r*10 + remi; + } + + if (r==z){ + return true; + } + else return false; + } + else + return false; + + } +}