[ create a new paste ] login | about

Link: http://codepad.org/UgX6eIBr    [ raw code | output | fork ]

Scheme, pasted on Apr 5:
1
2
3
4
5
6
(define C 
  (lambda (n k)
    (if (eq? k 0) 1
        (* (/ n k) (C (- n 1) (- k 1))))))

(display (C 5 2))


Output:
1
10


Create a new paste based on this one


Comments: