Write a program to check whether a given number is a
palindrome or not?

Answer Posted / ankita

//Program to check the given number is palindrome or not//


<html>
<head>
<script language="javascript">
var num,n,rev=0,r;
num=prompt("Enter the number");
n=num;
while(parseInt(num)>0)
{
r=parseInt(num)%10;
rev=parseInt(rev)*10+parseInt(r);
num=parseInt(num)/10;
}
if(rev==parseInt(n))
document.write(n+ " is a palindrome number");
else
document.write(n+ " is not a palindrome number");
</script>
</head>
<body>
</body>
</html>

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the difference between window & document in javascript?

470


Which software is used for javascript?

465


What is the result of below given line of code in java script? 5+4+'7'?

515


Explain javascript debounce function?

546


What is the function of delete operator?

562






What is difference between module.exports and export?

444


How many data types are there in javascript?

497


What is new function in javascript?

507


What's relationship between JavaScript and ECMAScript? And What are JavaScript types?

616


What is array explain it?

449


What is function overloading in javascript?

566


Is jquery easier than javascript?

465


What are javascript functions?

473


Does javascript have the concept level scope?

580


How do I turn off javascript in chrome?

464