Write a program to check whether a given number is a
palindrome or not?
Answer Posted / dk
<html>
<body>
<script type="text/javascript">
var n,n1,s,d;
n=prompt('Enter a Number.');
n1=n;
s=0;
while(n!=0)
{
d=n%10;
n=(n-d)/10;
s=(10*s)+d;
}
if(s==n1)
document.write(n1+" is a palindrome");
else
document.write(n1+" is not a palindrome");
</script
</body>
</html>
| Is This Answer Correct ? | 36 Yes | 8 No |
Post New Answer View All Answers
What is a framework programming?
what is the difference between wrappers and primitives es: diff between int i=200 in primitives and integeri = new integer(54)
How are event handlers utilized in javascript?
What are the ways to emit client-side javascript from server-side code in asp. Net?
What is the use of a number object in javascript?
What are the different objects used in javascripts?
What does js stand for?
What is difference between arrow function and normal function?
How to accessing elements using javascript?
How dhtml is used in javascript?
Why are callbacks used?
What is called variable?
Explain export & import in javascript?
What can be the challenges during testing a program or a system?
What are the four basic data structures in javascript?