Skip to content

Instantly share code, notes, and snippets.

@chelseatroy
Created October 29, 2019 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chelseatroy/637c0c64c886d212405a57175da35c12 to your computer and use it in GitHub Desktop.
Save chelseatroy/637c0c64c886d212405a57175da35c12 to your computer and use it in GitHub Desktop.
Recursive Function
(define (sum-n n)
(if (= n 0)
0
(+ n (sum-n (- n 1)))
)
)
(sum-n 5) ; 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment