SHARE
TWEET

Untitled

a guest Jul 12th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. int fact(int k);
  3. void main()
  4. {
  5.     int n,r,ncr;
  6.     printf("enter the values to and r:");
  7.     scanf("%d %d",&n,&r);
  8.     ncr=fact(n)/(fact(r)*fact(n-r));
  9.     printf("\n value of ncr=%d",ncr);
  10. }
  11.  
  12. int fact(int k)
  13.     {
  14.         if(k==1)
  15.             return(1);
  16.         else
  17.         return(k*fact(k-1));
  18.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top