include stdio include stdlib int main int double double printf Input s

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>
#include <stdlib.h>
int main() {
int n,i;
double x;
double f = 1;
printf("Input n: ");
scanf("%d",&n);
do{
printf("Input x: ");
scanf("%lf", &x);
if(((x-(int)x) < 0.0000001)&&((int)x<=2*n))
printf("Division by zero. Input other X. \n");
}while(((x-(int)x) < 0.0000001)&&((int)x<=2*n));
for( i=1 ; i<=n ; i++){
f*=(x-(2*i-1))/(x-2*i);
}
printf("f=%lf \n",f);
system("PAUSE");
return 0;
}