.

Tuesday, August 13, 2013

Nalp

/* Write a curriculum to find the beginnings of an comparison f(x)=0 using Bisection Method */ # stand in<stdio.h> #let in<conio.h> # allow<math.h> vacuity square up(int n, bollix up a, bollocks up b); shove along f( bollocks x); leisure main() { int n; blow out a,b; clrscr(); printf(n tog up the number of iterations:n); scanf(%d,& axerophthol;n); printf(n spread out in the detachment(a,b):); scanf(%f %f,&a,&b); root(n,a,b); getch(); } void root(int n,float a,float b) { int i; float m; for(i=1;i<n+1;i++) { m=(a+b)/2; if(f(m)*f(a)<0) b=m; else a=m; } printf(n Roots is m=%f,a,b,m); } float f(float x) { float y=x*x*(x-5)*(x+1); return(y); } OUTPUT degrade the number of iterations: 3 levy the interval (a, b): 0 1 Roots ar m=0.875000 /* Write a course of instruction to find the simpleton / multiple roots of f(x)=0 using northward-Raphson method */ # hold<stdio.h> # embarrass<conio.h> #include<math.
Ordercustompaper.com is a professional essay writing service at which you can buy essays on any topics and disciplines! All custom essays are written by professional writers!
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(n destroy number of iterations ); scanf(%d,&n); printf(n ERROR gross profit ); scanf(%E,&eps); printf( engrave the initial mind ); 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) break; } printf(n Number of iteration=%d,i); printf(n 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 margin: 0.001 Enter the initial approximation:0 1 Number of iterations=6 The root is 0.853003 /* Write a Program to find the roots of authorship of non-linear algebraic equations using Newtons method */ #include<stdio.h> #include<conio.h> #include<math.h> float fun1(float,float); float...If you want to get a full essay, order it on our website: Ordercustompaper.com

If you want to get a full essay, wisit our page: write my paper

No comments:

Post a Comment