11:27 PM C Programming Sheet - 5 |
#include"stdio.h"
int fact(int x);
int main(void)
{
int n, m, p;
printf("enter n and m [ n>m ] : ");
scanf("%d%d", &n, &m);
p = fact(n)/fact(n-m);
printf("P = %d", p);
getch();
return 0;
}
int fact(x){
int i, fx=1;
for(i=1;i<=x;i++){
fx*=i;
}
return fx;
}
|
|
Total comments: 0 | |