[My site ]
Main » 2013 » December » 12 » C Programming Sheet - 5
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;
}
Category: C Programming - 1 | Views: 384 | Added by: ahansaary | Rating: 0.0/0
Total comments: 0
Only registered users can add comments.
[ Sign Up | Login ]