Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is primitive data type in javascript?

881


Why is var better than let?

1057


What is a null variable in javascript?

967


Write the point of difference between web-garden and a web-farm?

916


How are javascript and ecma script related?

910


Is a parabola a function?

872


How to empty an array in JavaScript?

1016


Explain the difference between javascript and an asp script.

1056


What does question mark mean in react?

820


How to update a function in javascript?

1065


What is stack in javascript?

938


How to add behavior to an element using javascript?

989


Is it safe to use javascript?

907


How do I use javascript to password-protect my web site?

859


Explain the working of timers in JavaScript? Also elucidate the drawbacks of using the timer, if any?

966