Write a program to check whether a given number is a
palindrome or not?
Answer Posted / riddhi
<html>
<head>
<script language="Javascript">
var a;
</script>
<title> Number Palindrom </title>
</head>
<body>
<script Language="Javascript">
var rno=0;
var r=0;
var no = prompt("Enter First no: ","10");
var ono = parseInt(no);
while (no>0)
{
r = parseInt(no%10);
rno = parseInt((rno*10)+r);
no = parseInt(no/10);
}
document.write(rno);
if(rno == ono)
{
document.write(ono+" is palindrom number..");
}
else
{
document.write(ono +" is not palindrom number..");
}
</script>
</body>
</html>
| Is This Answer Correct ? | 72 Yes | 39 No |
Post New Answer View All Answers
Is html and javascript the same?
Is javascript enabled on my computer?
What are different types of scope chain available in javascript?
What are the decodeURI() and encodeURI()?
How to get the primitive value of a string in Javascript?
What are the various functional components in javascript?
What is undefined x 1 in JavaScript?
Which built-in method returns the characters in a string beginning at the specified location?
What are javascript closures?when would you use them?
What value does prompt() return if the user clicked the cancel button?
What does trim stand for?
Explain prototypal/differential inheritance?
How to create an object using javascript?
What does "1"+2+3 evaluate to?
What is javascript bom?