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?

Answers were Sorted based on User's Feedback



Write a program to check whether a given number is a palindrome or not?..

Answer / upendar

This Script checks the given number as well as string is palindrome or not


<html>
<body>
<script type="text/javascript">
function checkPalindrome() {
var revStr = "";
var str = document.getElementById("str").value;
var i = str.length;
for(var j=i; j>=0; j--) {
revStr = revStr+str.charAt(j);
}
if(str == revStr) {
alert(str+" -is Palindrome");
} else {
alert(str+" -is not a Palindrome");
}
}
</script>
<form >
Enter a String/Number: <input type="text" id="str" name="string" /><br />
<input type="submit" value="Check" onclick="checkPalindrome();"/>
</form>
</body>
</html>

Is This Answer Correct ?    437 Yes 107 No

Write a program to check whether a given number is a palindrome or not?..

Answer / srikanth

malayalam

Is This Answer Correct ?    119 Yes 45 No

Write a program to check whether a given number is a palindrome or not?..

Answer / riddhi

<html>
<head>
<script language="Javascript">
var a;
</script>
<title> Number Palindrom </title>
</head>
<body>
<script Language="Javascript">
var rno=0;
var r=0;
var no = prompt("Enter First no: ","10");
var ono = parseInt(no);
while (no>0)
{
r = parseInt(no%10);
rno = parseInt((rno*10)+r);
no = parseInt(no/10);
}
document.write(rno);
if(rno == ono)
{
document.write(ono+" is palindrom number..");
}
else
{
document.write(ono +" is not palindrom number..");
}
</script>
</body>
</html>

Is This Answer Correct ?    72 Yes 39 No

Write a program to check whether a given number is a palindrome or not?..

Answer / 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

Write a program to check whether a given number is a palindrome or not?..

Answer / praveen

12121

Is This Answer Correct ?    21 Yes 4 No

Write a program to check whether a given number is a palindrome or not?..

Answer / ss

1221

Is This Answer Correct ?    28 Yes 13 No

Write a program to check whether a given number is a palindrome or not?..

Answer / sharma v

num=InputBox ("Enter a number")
z=num
r=0
While(num>0)
rem1=num mod 10
num=num\10
r=(r*10) + rem1

Wend

If (r=z)Then
Msgbox "Given no is palindrome"
else
Msgbox "Given no. is not palindrome"

End If

Is This Answer Correct ?    23 Yes 17 No

Write a program to check whether a given number is a palindrome or not?..

Answer / 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

Write a program to check whether a given number is a palindrome or not?..

Answer / renuga devi

mam,16061

Is This Answer Correct ?    6 Yes 3 No

Write a program to check whether a given number is a palindrome or not?..

Answer / kamal kumar

<script>
function bon()
{
var y="";
var j= document.getElementById("ty").value;
var k = j.split('');
for(var l= k.length; l>0; l--)
{
y+=k[l-1];
}
if(j==y)
{
alert("This is Palidrome");
}
else
{
alert("This not Palidromn");
}
}
</script>
<body>
<input type="number" id="ty">
<button onclick=" bon()"> Come On!</button>
</body>

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More JavaScript Interview Questions

What is the purpose of using javascript?

0 Answers  


What is a hash javascript?

0 Answers  


Create a new javascript object with the keys of “fname” equal to your first name, “lname” equal to your last name, and “fcolors” equal to and array of 3 of your favorite colors. Assign this object to a variable called “me” and log it to the console.

0 Answers  


since are functions need to create a webpage is available in dhtml& html. then why we are going for javascript

1 Answers  


Explain typecasting in javascript?

0 Answers  


How to remove duplicate values from a javascript array?

0 Answers  


hi iM rahul.my questions is my project is a web based & developed using java,jsp. when i record it using qtp what script i will get like either browser("jdfjkf").page("nkf").... or javawindow("f d ").javaedit("Dasf").... plz clarify my doubt asap and i also need some vbscipt of java coding?

0 Answers  


Can we learn javascript without knowing java?

0 Answers  


You have an asp. Net web application running on a web-farm that does not use sticky sessions - so the requests for a session are not guaranteed to be served the same machine. Occasionally, the users get error message validation of view state mac failed. What could be one reason that is causing this error?

0 Answers  


What is arguments object in JavaScript?

0 Answers  


What are the new ways to define a variable in Javascript?

0 Answers  


How to create an array in javascript?

0 Answers  


Categories