Palindrome (logic is correct but why this error)

class Solution {
public boolean isPalindrome(int x) {
int rem,sum=0,qu,cp;
cp = x;
while(x!=0)
{
rem = x%10;
sum = (sum*10)+rem;
qu = x/10;
}
if(sum == cp)
return true;
else
return false;
}
}

Comments (1)