Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (factorial n)
- (cond
- ((= n 0) 1)
- (else
- (* n (factorial (- n 1)))
- )
- )
- )
- ;(factorial 6)
- (define (fibonacci n)
- (cond
- ((= n 0) 0)
- ((= n 1) 1)
- (else
- (+ (fibonacci (- n 1)) (fibonacci (- n 2)))
- )
- )
- )
- (fibonacci 17)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement