Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n, m=0, rem, temp;
  8. cout << "Enter the integer" << endl;
  9. cin >> n;
  10.  
  11. temp=n;
  12. while(temp!=0){
  13. rem=temp%10;
  14. m=m*10+rem;
  15. temp=temp/10;
  16. }
  17.  
  18. if(n==m){
  19. cout << "Palindrome" << endl;
  20. }else {
  21. cout << "Not a palindrome" << endl;
  22. }
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement