Quick Solution by conversion into string


#1

string b=to_string(A);
int i=0,j=b.size()-1;
while(i<j){
if(b[i]==b[j]){
i++; j–;
}
else return 0;
}
return 1;


#2

u can use simple reverse() function
b=to_string(A);
if(!compare(b,reverse(b.begin(),b.end())
return 1
else
return 0