#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
int n,i=1,x,j,fact;
double sum=1.1;
printf("Enter the range of number:");
scanf("%d",&n);
printf("Enter the value of x:");
scanf("%d",&x);
while(i<=n)
{
fact=1;
for(j=1;j<=i;j++)
{
fact=fact*j;
sum+=pow(x,i)/fact;
}
i++;
}
printf("The sum of the series = %0.2lf",sum);
getch();
return 0;
}
Enter the range of number:5
Enter the value of x:3
The sum of the series = 618.13
--------------------------------
Process exited after 13.85 seconds with return value 0
Press any key to continue . . .