Skip to content

Commit

Permalink
1.30
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmin committed Feb 22, 2012
1 parent 2d516c7 commit 34c5457
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions exercise-1-30.ss
@@ -0,0 +1,11 @@
(define (cube x) (* x x x))
(define (inc x) (+ x 1))

(define (sum term a next b)
(define (iter a result)
(if (> a b)
result
(iter (next a) (+ (term a) result))))
(iter a 0))

(= 3025 (sum cube 0 inc 10))

0 comments on commit 34c5457

Please sign in to comment.