Palindrome Number Checker in C++

I wrote this program that will ask the user to give integer and then the program will determine and check if the given number is a palindrome or not a palindrome using a C++ programming language.


My email address is the following,, and
My mobile number here in the Philippines is 09173084360.


My personal website is

My programming website is


My video tutorial on my YouTube Channel.
Sample Program Output
Sample Program Output

Program Listing


#include <iostream>
#include <stdlib.h>

using namespace std;

int main()
    int n=0,num=0,digit=0,rev=0;
    cout <<"\n\n";
    cout <<"\tPalindrome Number Checker in C++ ";
    cout <<"\n\n";
    cout <<"\tGive a Positive Number : ";
    cin >> num;
    n = num;
    do {
        digit = num % 10;
        rev   = (rev * 10) + digit;
        num = num / 10;
        } while (num !=0);
    cout << "\tThe reverse of number is " << rev <<"\n";
    cout <<"\n\n";
    if (n == rev) {
          cout << "\tThe given number " << n<< " is a Palindrome.";
         else {
                    cout << "\tThe given number " << n << " is  Not a Palindrome.";    
    cout <<"\n\n";
    cout << "\tEnd of the Program"; 
    cout <<"\n\n";