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
what is the function of public class main ?
What is use strict in javascript?
Is notepad ++ an ide?
Between JavaScript and an ASP script, which is faster?
What is the difference between window.onload and ondocumentready?
Write a program to exaplain the deferred scripts using event handlers in javascript.
What does clean white space mean?
What are Cookies in Javascript?
Taking a developer's perspective, do you think that that javascript is easy to learn and use?
What is the most popular javascript library?
Write a program in Java to display the IP address of the local and remote machine.
What are exports & imports?
List the comparison operators supported by javascript?
What is the === in javascript?
What are the methods involved in javascript?