clc;
clear;
%%e0 (ACTUAL VALUE OF e)
e0=exp(1);
%%loop for calculation of 1/e=x
i=2;
while i>0
x=(1-1/i)^i;
e=1/x;
if abs(e0-e)<.0001
break;
end
i=i+1;
end
n_for_approx_e=i
e_calculated=1/x
Problem Three: (Based on Attaway, Chapter 5, Exercise 20) The inverse of the mathematical constant e can be approximated as follows: a c 7n Write a script that will loop through values of n (star...
Self-check exercise: While-loops The value of (π^2)/8 can be approximated by the series Write a script that evaluates this expression, ignoring all terms that are strictly smaller than .000001. Your script should display the number of terms summed and the sum. Use a while-loop. Think about the initialization of your variables and the order of computation carefully! In the loop body you need to calculate the value of a term only once. We use the above series for approximating (π^2)/8...