# Answer to Question #64446 in C# for ceazer

Question #64446

Write an application that estimates the value of the mathematical constant e by using the following formula. Allow the user to enter the number of terms to calculate.

e= 1 + 1/1! + 1/2! + 1/3! + ...

Expert's answer

int input = Convert.ToInt32(Console.ReadLine());

double result = 1;

for(int i = 1; i <= input; i++){

int fact = 1;

for (int j = 2; j <= i; j++)

fact *= i;

result += 1.0/fact;

}

Console.WriteLine(result);

double result = 1;

for(int i = 1; i <= input; i++){

int fact = 1;

for (int j = 2; j <= i; j++)

fact *= i;

result += 1.0/fact;

}

Console.WriteLine(result);

Need a fast expert's response?

Submit orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment