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! + ...
1
Expert's answer
2017-01-12T11:15:19-0500
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; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment