nt main int argc char argv int double temp Sin raz printf VVedite scan

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
nt main(int argc, char *argv[])
{
int n=1, t=0;
double x,a,s,temp,Sin,raz;
printf("VVedite x\n");
scanf("%lf",&x);
s=a=x;
temp=s;
while (a>EPS || a<-EPS)
{
t++;
n++;
a*=-x*x/(2*n*(2*n+1));
temp=a;
s+=a;
}
printf("t=%d\n",t);
Sin= sin (x);
raz=fabs(s-Sin);
printf("s=%lf\n",s);
printf("sin=%lf\n",Sin);
printf("otlichie=%lf\n",raz);
system ("PAUSE");
return 0;
}