Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, m=0, rem, temp;
- cout << "Enter the integer" << endl;
- cin >> n;
- temp=n;
- while(temp!=0){
- rem=temp%10;
- m=m*10+rem;
- temp=temp/10;
- }
- if(n==m){
- cout << "Palindrome" << endl;
- }else {
- cout << "Not a palindrome" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement