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
How do you declare in javascript?
What is the difference between null and undefined?
Is there any difference between javascript and jscript?
What is the difference of "settimeout" function and setinterval functions in javascript
Example of using regular expressions for syntax checking in javascript?
What is hoisting in javascript?
How to get height and width of different browser in Javascript?
Can we learn javascript without knowing java?
Can you assign an anonymous function to a variable and pass it as an argument to another function?
Write a Program using Servlet and JDBC for developing online application for displaying the details of Cars owned by the residents in XYZ society. Make necessary assumptions and create appropriate databases
Taking a developer's perspective, do you think that that javascript is easy to learn and use?
What does the term sticky session mean in a web-farm scenario? Why would you use a sticky session? What is the potential disadvantage of using a sticky session?
What is console.log() and why it is used?
Is function a data type in javascript?
How to redirect a url using JavaScript?