Answers for "write a c program to find out ncr factor of given number"

C
0

write a c program to find out ncr factor of given number

#include <stdio.h>
int Cal_Fact(int);  
int main()
{
  int n, r, ncr; 
  printf("\n Please Enter the Values for N and R: \n");
  scanf("%d %d", &n, &r);
  ncr = Cal_Fact(n) / (Cal_Fact(r) * Cal_Fact(n-r));
  printf("\n NCR Factorial of %d and %d = %d", n, r, ncr);
  return 0;
}
int Cal_Fact(int Number)
{ 
  int i; 
  int Factorial = 1;
 
  for (i = 1; i <= Number; i++)
   {
     Factorial = Factorial * i;
   }
  return Factorial;
}
Posted by: Guest on March-06-2022

Code answers related to "write a c program to find out ncr factor of given number"

Code answers related to "C"

Browse Popular Code Answers by Language