Professional Documents
Culture Documents
Lab06 A3 2020
Lab06 A3 2020
Markov series
1 a
xn xn 1 a i
2 xn 1
Determine the first term in the series for which the relative error (err) is less than a given
epsilon (eps)
xn a
err <eps
a
The number a and the first term of the series x1 are also given.
At the end of the program the user will be asked if he wants to run the program again by
typing with y for yes and n for no
err=1;
while (err>eps){
x2=0.5*(x1+a/x1);
x1=x2;