#include<stdio.h>
#include<math.h>
int main()
{
int a, b, c, i;
double x=-0.8, s, si, eps, y;
printf("Enter eps:");
scanf("%lf", &eps);
for (x=-0.8;x<1;x+=0.2)
{
si=1.0; s=1.0; a=2; b=3; c=4; i=1;
while (fabs(si)<eps)
{
si=(1.0/6)*a*b*c*pow(x,i);
s+=si;
a+=1;
b+=1;
c+=1;
i+=1;
}
y=pow(1-x,-4);
printf("x=%lf\t y=%lf\t s=%lf",x,y,s);
printf("\n\n");
}
return 0;
}
#include<math.h>
int main()
{
int a, b, c, i;
double x=-0.8, s, si, eps, y;
printf("Enter eps:");
scanf("%lf", &eps);
for (x=-0.8;x<1;x+=0.2)
{
si=1.0; s=1.0; a=2; b=3; c=4; i=1;
while (fabs(si)<eps)
{
si=(1.0/6)*a*b*c*pow(x,i);
s+=si;
a+=1;
b+=1;
c+=1;
i+=1;
}
y=pow(1-x,-4);
printf("x=%lf\t y=%lf\t s=%lf",x,y,s);
printf("\n\n");
}
return 0;
}