For Advertisements on this blog Contact Us at developgram@gmail.com or +91-9923438816

Simple Programming Tutorials For Beginners

Tuesday, April 18, 2017

Reverse String

<html>
<body>
  <script>
    var str, rev = "", length, i;
    str = prompt("Enter a String");
    length = str.length;

    for(i = length-1; i >= 0; i--)
    {
      rev += str.charAt(i);
    }
    document.write(rev);
  </script>
</body>
</html>



No comments:

Post a Comment

SEARCH THIS BLOG