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 different ways of empty an array in javascript?

901


just for testing

2187


Is python better than javascript?

913


What is arguments object in JavaScript?

1195


What is the difference between push() and concat() in javascript?

1176


What do ellipses mean in javascript?

960


How do I open javascript console?

1015


What are two-way data binding and one-way data flow, and how are they different?

1108


How to open url in a new tab in javascript?

1034


What web sites do you feel use javascript most effectively (i.e., Best-in-class examples)? The worst?

974


Can you explain how inheritance works in javascript?

982


How do you clear an array in javascript?

994


What is the difference between ‘let’ and ‘const’?

1123


What’s relationship between javascript and ecmascript?

1162


Write a main method that prompts the user to enter the starting population, birth and death rates, and the number of years. The input birth and death rates cannot be negative, the starting population cannot be less than 2, and the number of years greater than 0. If the user enters an invalid value, this program will prompt user to re-enter the value until a valid value has been read. When all input values are valid, call on the methods above to compute estimated population and print result.

2337