Is using log for calculation of huge number (floating point) saves precision ?? Consider these two solutions :
The concept for both solutions is almost same,in the second solution i am first calculating the last term and then to calculate and then calculating the previous term from current term because suppose we know the value of nck then to know the value of nCk-1 we need to multiply nCk by k and divide by (n-k+1) this gives us nCk-1.