I am trying to write a program which should calculate, e^x with taylor series expansion, but when i tried big numbers like e^70, i got segmentation fault error, Can you please help me. Code is like that;

Code:#include<stdio.h> #include<math.h> double factoriel(int n) { if(n==0 || n==1) return 1; else return (n*factoriel(n-1)); } double taylor(int n) { int k=0; double sum=0; double term; while(1) { term= (double)pow(n,k)/factoriel(k) ; sum +=term; if(fabs(term)<0.00001) break; k++; } return sum; } int main() { int num; printf("Enter a number: "); scanf("%d",&num); if (num<0) printf("e^%d = %4e\n",num,1/taylor( fabs(num) )); else printf("e^%d = %4e\n",num,taylor(num)); }