Number of n | Returns factorial of n ; returns nCr ; Driver code
function fact ( n ) { var res = 1 ; for ( var i = 2 ; i <= n ; i ++ ) res = res * i ; return res ; } function nCr ( n , r ) { return fact ( n ) / ( fact ( r ) * fact ( n - r ) ) ; } var n = 2 ; document . write ( " " + nCr ( n + 9 , 9 ) ) ;