Forum : Palindrome
Brief description  about Online courses   join in Online courses
View Alok Ranjan Rai 's Profile

Palindrome

Dear Sir,
this is code for reverse.


function reverse() {

var inp = document.rev.inpt.value
var outp = ""

for (i = 0; i <= inp.length; i ) {
outp = inp.charAt (i) outp
}

document.rev.outpt.value = outp
}
</SCRIPT>


</head>
<body>
<FORM ACTION="#" NAME="rev">
<INPUT TYPE=TEXT NAME="inpt" SIZE=20>
<INPUT TYPE=BUTTON VALUE="Reverse" ONCLICK="reverse()"><BR>
<INPUT TYPE=TEXT NAME="outpt" SIZE=20 DISABLED>

but i don't know what is palindrome and how to define.
Asked by Alok Ranjan Rai | Feb 4, 2011 |  Reply now
Replies (2)
View alok ranjan rai 's Profile
Thanks Sir
Feb 7, 2011
View teacher siliconindia 's Profile
Hi Alok,

If reverse of a string is same as original string...that is palindrome
Feb 7, 2011