Program to calculate ncr=n!/r!*n-r!and npr using function flowchart
Answers
Answered by
1
Answer:
Program to calculate ncr=n!/r!*n-r!and npr using function flowchart
Answered by
0
Answer:
#include<stdio.h>
int fact(int) ;
void main()
{
int n, r, ncr;
printf("\n enter n&r where n>r")
scanf("%d %d", &n, &r")
ncr=fact(n) /((fact(r) *fact(n-r))) ;
printf("\n NCR=%d", ncr) ;
}
int fact(int x)
{
int f=1;
int I;
for(i=1;i<=x;i++)
f=f*i;
return(f) ;
}
Similar questions