Horje
write a c program to find out ncr factor of given number Code Example
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;
}




C

Related
ringing a bell using c Code Example ringing a bell using c Code Example
Defining a macro in a header file Code Example Defining a macro in a header file Code Example
how to insert elements in and array and print it in c Code Example how to insert elements in and array and print it in c Code Example
clarity ppm jasper domain commands Code Example clarity ppm jasper domain commands Code Example
entity framework core discard changes Code Example entity framework core discard changes Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9