/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <iostream> using namespace std; class Solution { public: bool isPalindrome(int x) { string str = to_string(x); for(int i = 0; i < str.length() / 2; i++){ if(str[i] != str[str.length() - i - 1]) return false; } return true; } }; int main() { Solution a; int x; cout<< "enter a number"; cin>>x; cout<<a.isPalindrome(x); }