Skip to content

Instantly share code, notes, and snippets.

@prathamesh-sonpatki
Created May 18, 2019 14:45
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 prathamesh-sonpatki/9aacca2cecb6fb765d32f21c18819e23 to your computer and use it in GitHub Desktop.
Save prathamesh-sonpatki/9aacca2cecb6fb765d32f21c18819e23 to your computer and use it in GitHub Desktop.
(define (square x)
(* x x))
(define (sum-of-squares a b)
(+ (square a) (square b)))
(define (sum-of-squares-of-two-largest a b c)
(if (>= a b)
(sum-of-squares a (max b c))
(sum-of-squares b (max a c))
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment