C++ Program to Check Number is Palindrome or not.


#include<iostream> using namespace std; int main(){ int i,num,rev=0,r,n; cout<<"Enter a number :"<<endl; cin>>num; n=num; while(num>0){ r=num%10; rev=rev*10+r; num=num/10; } if(n==rev) cout<<"The Palindrome Number is :"<<rev; else cout<<"The Number is Not Palindrome:"<<rev; return 0; }

Output:-

Enter a number :191
The Palindrome Number is :191