/* C++ Program To Check Whether The Given Number Is Palindrome Or Not */ #include <iostream> using namespace std; int main() { int number,rev=0; cout<<"Enter The Number:"<<endl; cin>>number; int temp=number; while(number>0) { int rem=number%10; number=number/10; rev=(rev*10)+rem; } if(rev==temp) cout<<"The Given Number "<<temp<<" Is A Palindrome Number."<<endl; else cout<<"The Given Number "<<temp<<" Is Not A Palindrome Number."<<endl; return 0; }
Enter The Number: 121 The Given Number 121 Is A Palindrome Number.
No comments:
Post a Comment