#include <stdio.h>
#include <math.h>
int fact(int x) {
if (x == 0) return 1;
return x * fact(x - 1);
}
int main(void){
double x = 2, sum = 0, e = 0.1, truesumm;
int k =0;
truesumm = (exp(x)-exp(-x))/2;
printf("True summ =\t%f\n", truesumm);
while ((sum-truesumm)<e){
k=k+1;
sum=sum+(pow(x,(2*k-1))/fact(2*k-1));
}
printf("Summ of array =\t%f\n", sum);
printf("Numbers of iteration =\t%d\n",k);
return 0;
}