You are on page 1of 1

PROGRAM ON SUCCESSIVE APPROXIMATION METHOD (BASED ON ITERATION): clc; x1=input('Enter the initial guess x1:'); n=input('Enter the iteration

no.:'); a=(x1*x1)/5; while(abs(a)>1) x1=input('Enter again the initial guess x1:'); x2=((x1*x1*x1)+8)/15; a=(x1*x1)/5; end for(i=1:n) x2=((x1*x1*x1)+8)/15; x1=x2; end fprintf('\n New root is=%f', x2); OUTPUT: Enter the initial guess x1:1 Enter the iteration no.:5 New root is=0.544071

You might also like