I have this code in my my C++ dev console that is supposed to check if a given input number is palindromic(when reversed, its still the same number). The problem is that i don't know how to iterate through the calculations to check whether its true and print the required statements

```
#include <iostream>
using namespace std;

bool isPalindrome(int x) {
     int rev=0;
    //complete the function
    while(x>0){
      rev = rev*10 + x%10;
      x = x/10;
      cout<<rev<<endl;cout<<x<<endl;

    }
      if(x==rev){
        return true;
      }else{
       return false;
     }

   }

int main() {
    int n;
    cin >>n;

    if(isPalindrome(n)) {
        cout <<n<<" is a palindrome";
    }
    else {
        cout << n<<" is NOT a palindrome";
    }
    return 0;
}

```

When i input a number like 707 or 808 which are obviously palindromic, it prints the second statement that 707 is not a Palindrome number, Please help me rectify it