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