2. (A) Program to solve algebraic and transcendental equation by bisection method
| ||
| d=0.0001; // for accuracy of root | ||
| c=1; | ||
| printf('successive approximations \tx1 \t \tx2 \t \tm \t \f f(m) \n') | ||
| while abs (x1-x2)>d | ||
| m=(x1+x2)/2; | ||
| printf('\t%f \t%f \t%f \t%f \n',x1,x2,m,f(m)); | ||
| if f(m)*f(x1)>0 | ||
| x1=m; | ||
| else | ||
| x2=m; | ||
| end | ||
| c=c+1; // to count number of iterations | ||
| end | ||
| printf(' the solution of equation after %i iteration is %g',c,m) |
2. (A) Program to solve algebraic and transcendental equation by bisection method
Reviewed by admin
on
December 24, 2019
Rating:
No comments: