Explanation:
#include <iostream.h>
#include <conio.h>
#include <math.h>
main ()
{
int x;
double sum, fact;
char ans;
do
{
cout << "Please enter the value x: ";
cin >> x;
cout << endl;
sum = fact = 1;
for (int n=1; n<=100; n++)
{
for (int i=0; i<n; i++)
{
fact = n*fact;
}
sum += (pow(x,n)/fact);
cout <<"n = "<<n<<" and sum = "<< sum << " and
exp("<<x<<") = "<<exp(x)<<endl;
}
cout << endl;
cout << "Do you want to calculate this again? (y/n): ";
cin >> ans;
} while (ans == 'y' || ans == 'Y');
getch ();
}