编写主函数和函数。级数

#include<stdio.h>
double fn (int a) :
const double eps=1e-8;
int main()
{
int X;
double t;
printf ("'Input x:");
scanf ("%d"' , &x) ;
t=fn(x);
printf("1+x-x^2/2!+..+(-1)^(n+1)*x^n/n!=f",t);
return 0:
}

double fn(int a) {
double sum=0,up=1, low=1.0, term=1.0, f=1.0;
while(term>eps){
sum=sum+term;
up=fupa;
f=-f,
term=up/low;
return sum;
}
}
有什么问题啊

#include<stdio.h>
#include<math.h>
double fn (int a);
const double eps=1e-8;
int main() {
    int x;
    double t;
    printf ("Input x:");
    scanf ("%d", &x) ;
    t=fn(x);
    printf("1+x-x^2/2!+..+(-1)^(n+1)*x^n/n!=%f",t);
    return 0;
}
double fn(int a) {
    int k=1,low=1;
    double sum=0,up=1, term=1.0, f=1.0;
    while(fabs(term)>eps) {
        sum=sum+term;
        low=low*k;
        term=f*up*a/low;
        k++;
        f=-f;
    }
    sum+=term;
    return sum;
}