#include<stdio.h>
#include<math.h>
#define PI 4*atan(1)
int main(void){
int i=0;
double fAns,inp,power,factor;
//printf ("\nPlease enter a value for X: ");
//scanf("%lf",&inp);
inp=3;
for(i=2; i<=90; i+=2){
int j=0+i;
printf("%i\n",i);
power=pow(inp,j);
factor=factorial(i);
if(i%4==0)fAns += power/factor;
else fAns -= power/factor;
}
printf("\nSum of the series is %lf",fAns);
double cosine_x(double deg){
deg = deg*2*PI;
double sum = 0,k=0,ans,x;
while(k<3){
double th = 2*k;
ans = pow(1,k)*pow(x,th)/fact(2*k);
}
}
return 0;
}
int factorial(int n){
int fact=1,i;
for (i=1;i<=n; ++i)
{
fact *= i;
}
return (fact);
}