h> float eps; void iter(int n,float x); float f(float x); float df(float x); void main() { int n; float a; clrscr(); printf( Enter number of iterations ); scanf(%d,&n); printf( hallucination margin ); scanf(%E,&eps); printf(Enter the initial estimation ); scanf(%f,&a); iter(n,a); getch(); } void iter(int n,float x) { int i; i=0; for(i=1;i<=n;i++) { x=x-(f(x)/df(x)); if(fabs(f(x))<=eps) lay off; } printf( Number of iteration=%d,i); printf( the root is %f,x); } float f(float x) { return(x*exp(x)-2); } float df(float x) { return(exp( x)*(x+1)); } OUTPUT Enter the number of! iterations: 5 ERROR permissiveness: 0.001 Enter the initial appraisal:0 1 Number of iterations=6 The root is 0.853003 /* Write a Program to find the roots of constitution of non-linear algebraical equations using Newtons method */ #include<stdio.h> #include<conio.h> #include<math.h> float fun1(float,float); float...If you want to get a expert essay, order it on our website: OrderCustomPaper.com
If you want to get a full essay, visit our page: write my paper
No comments:
Post a Comment