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

How long does it take to learn javascript?

663


What is 'use strict'?

696


Explain event bubbling and event capturing in javascript?

646


What is a callback url?

697


What does break and continue statements do in javascript?

700


Give an example of closure?

702


How do you declare in javascript?

647


How can javascript codes be hidden from old browsers that don't support javascript?

708


Which software is used for javascript?

653


What is lambda in programming?

649


How do I unblock javascript in chrome?

726


How are tag positions used in javascript?

634


What is the scope variable in javascript?

717


How to get complete current page url with javascript?

650


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

2029