How to solve this calculation ?

C(N,K)%M , where M is a prime number , N and K is very big number (N<=10^6), How is solution ?

@mehemmedv : Refer to this thread :

You will need to precompute factorials and use the idea of multiplicative inverse .

@vineetpaliwal Thanks.

You’re welcome.