#include <stdio.h>
int main()
{
double x,result=1,term=1;
int n;
printf("Enter the value of x: \n");
scanf("%lf",&x);
printf("Enter the number of terms (n) : \n");
scanf("%d",&n);
for (int i=1;i<=n;i++)
{
term *=x/i;
result+=term;
}
printf("e^%.2lf is %.6lf\n",x,result);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: