Saturday, 3 November 2018

Program for finding whether a given number is Palindrome or not using JavaScript.

Learn to Make a program for checking whether the  number is palindrome or not using JavaScript .
                                                        (2 minutes coding)

                                         Steps to make your own program



1.  Open NOTEPAD or NOTEPAD++ in your computer .

                                     
2.Copy the code given below .
<!doctype html>
<html>
<head>
<script>
function palindromefunc()
{
var a,num,b,temp=0;

num=Number(document.getElementById("Palindrome_no").value);

b=num;
while(num>0)
{
a=num%10;
num=parseInt(num/10);
temp=temp*10+a;
}
if(temp==b)
{
alert("The number entered is a Palindrome number");
}
else
{
alert("The number entered is not a Palindrome number");
}
}
</script>
<body bgcolor="grey" text="white">
<h1>Palindrome Calculator</h1>
Enter any Number: <input id="Palindrome_no"><br>
<button onclick="palindromefunc()">

Check</button></br></br>
</body>

</html>

3.Now paste it in your Notepad file.




4.Now save your file with .html extension.
5. File will appear like this.


6. Now open the file in any browser and check the number.





1 comment:

👇 🌐 Top 10 Hosting for Developers in 2025: Fast, Reliable & Affordable

 Whether you’re a beginner building your first portfolio site or a professional developer deploying client projects, choosing the right host...