Advertisement
skashminzim

nCr

May 1st, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.16 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {int n,r,z,x=1;
  4. int y=1;
  5. scanf("%d %d",&n,&r);
  6. while (r>0)
  7.     {x=x*n;
  8.     n=n-1;
  9.     y=y*r;
  10.     r=r-1;}
  11. z=x/y;
  12. printf("%d",z);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement