include stdio include stdlib define eps 1e-5 int main void double chis

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>
#include <stdlib.h>
#define eps 1e-5
int main(void)
{
double r=1,s=0,chisl,znam,n=1,x;
printf("enter x");
scanf("%lf",&x);
chisl=(x-1);
znam=x;
r=chisl/znam;
while(r>eps || r<eps)
{
s+=r;
n++;
chisl*=(x-1);
znam*=x;
r=chisl/(znam*n);
}
printf("%lf\n",s);
system("pause");
return 0;
}