Skip to content

Instantly share code, notes, and snippets.

@deadghost
Created July 1, 2014 01:31
Show Gist options
  • Save deadghost/5c4e7a99ecd87bd850d4 to your computer and use it in GitHub Desktop.
Save deadghost/5c4e7a99ecd87bd850d4 to your computer and use it in GitHub Desktop.
SICP 1.3
;;;; Ex 1.3
;;; Define a procedure that takes three numbers as arguments and returns the sum
;;; of the squares of the two larger numbers.
(define (sum-sq n1 n2 n3)
(if (and (< n1 n2) (< n1 n3))
(+ (* n2 n2) (* n3 n3))
(sum-sq n2 n3 n1)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment