Skip to main content

Posts

Showing posts with the label Newtonraphson Method

Newtonraphson Method

#include<iostream.h> #include<conio.h> #define EPSILON 0.01 double fun(double X) { return X*X*X+X*X+9X; } double derive fun(double X) { return 3*X*X+2*X+9; } void newtonraphson(double X) { double h=fun(X)/drive fun(X); while (abs(h)>=EPSILON) {     h=fun(X)/drive fun(X);     X=X-h;     }     cout<<" The value of root "<< x;     }     void main( )     {     X=200;     newtonraphson (x);     getch( );     }