The factorial Example


(define factorial-code
  '(lambda (n)
     (if (<= n 1)
         1
         (* n (factorial (- n 1))))))


function factorial(n:integer):integer;
   begin
      if n <= 1
         then 
              factorial := 1
         else 
              factorial := n * factorial(n - 1)


int factorial(int n) {
   {
      if (n <= 1)
              return(1);
         else 
              return(n * factorial(n - 1));;
   }}  // factorial


public static long factorial(long n) {
   {
      if (n <= 1)
              return(1);
         else 
              return(n * factorial(n - 1));;
   }}  // factorial

Contents    Page-10    Prev    Next    Page+10    Index