Problem#1
Find the sum of the n terms for the sequence
1/(x^n)
Input: x n
output:
Term_no sum
for all term leading to n
Example input:
Example Output:
Problem#2
Find the approximation of e^x using maclaurin series for %Ea <n%
Input: x n
Output:
interation_no approximation %Ea
for every iteration
Example input:
0.5 0.0001
Example Output:
2 Approximation=1.500000 Error=50.000000 3 Approximation=1.625000 Error=8.333333 4 Approximation=1.645833 Error=1.282051 5 Approximation=1.648438 Error=0.158228 6 Approximation=1.648698 Error=0.015798 7 Approximation=1.648720 Error=0.001316 8 Approximation=1.648721 Error=0.000094 Approximation for e^0.500000 with 0.000094% error is 1.648721