var n = 121; var sum = 0, r; var temp = n; while(n>0) { r = n % 10; sum = (sum*10)+r; n = n/10; } if(temp==sum) console.log("It is a Palindrome number."); else console.log("Not a palindrome");
Java
Javascript
Quote:n = n/10;
n = Math.floor(n/10);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)