JavaScript code using recursive Functions

JavaScript code using recursive Functions 

<html>
 <body>
  <script>
   function factorial(n) {
    if (n <= 0) 
     return 1 ;
    else
     return n * factorial(n - 1) ;
   }
   document.writeln(factorial(5)) ;
  </script>
 </body>
</html>

Comments

Popular posts from this blog

Artificial Intelligence

The taxonomy of CASE Tools

Zoho Second round - adding a digit to all the digits of a number