0 Replies - 1046 Views - Last Post: 04 June 2010 - 08:33 PM

#1 Crunch  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 139
  • View blog
  • Posts: 1,222
  • Joined: 28-July 09

[Scheme] Add the first n numbers recursively

Posted 04 June 2010 - 08:33 PM

Description:
(define add
  (lambda (n)
    (if (= n 0)                  
        0                       
        (+ n (add (- n 1))))))

Is This A Good Question/Topic? 0
  • +

Page 1 of 1