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 / abhijeet gupta

var num=123211;
var str=""+num;
for(var i=0;i<str.length/2;i++){
if(str.charAt(i)!==str.charAt(str.length-1-i)) {
console.log("Not Palindrome");
return;
}
}
console.log("palindrome")

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List few difference between java and javascript?

1012


How can JavaScript be used?

959


What is the difference between java & javascript?

1089


What is node ecosystem?

893


How does javascript work?

964


How can a value be appended to an array?

953


What is difference between java and javascript?

1024


Can you give an example showing javascript hoisting?

862


What is event bubbling in JavaScript?

1016


What is eval() in javascript?

1078


What is difference == and === in javascript?

984


What is difference between local variable and global?

932


What is the result of below given line of code in java script? 5+4+'7'?

906


How to add html elements dynamically with JavaScript?

978


What is the use of decodeuri() and encodeuri()?

985