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
What does three dots mean in texting?
How to replace all occurrences of a string in JavaScript?
What are self Executing Functions?
What is the use of history object?
Are namespaces are there in javascript?
List html dom mouse events?
What javascript method would convert the string “20” to an integer (on the fly) so “20” + 20 = 40?
What are exports and imports?
How can a value be appended to an array?
Write the code for adding new elements dynamically?
What is the use of dom?
How can you get the reference of a caller function inside a function?
Is there any class in javascript?
What does the operator do in javascript?
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