mulla

<html>
<head>
<title>palindrome</title>
</head>
<body>
<script>
var str=prompt(“Enter the string:”);
var flag=0;
var len=str.length;
for(var i=0;i<len/2;i++)
{
if(str[i]!=str[len-i-1])
{
flag=1;
}
}
if (flag==0)
alert(“Is a palindrome”);
else
alert(“Not a palindrome”)
</script>
</body>
</html>

Scroll to Top