include stdio include stdlib define EPS 1e-5 int main void unsigned in

 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>
#define EPS 1e-5
int main(void)
{
unsigned int n=0;
double s,x,a;
printf("Enter x");
scanf("%lf",&x);
a=1;
s=1;
do
{
a*=x*x/(2*(n+1));
s+=a;
n++;
}
while(a>EPS || a<-EPS);
printf("%lf",s);
system("pause");
return 0;
}