// Newton-Raphson Method #include #include #include // Define your funtion here; adjust per your requirement #define f(x) (x+log(x)-2) // First derivative of the above function #define d(x) (1+(1/x)) main() { float x, y, a, b, i; printf("\n Enter the values of a and b: "); scanf("%f\t%f",&a,&b); x = (a+b)/2; for(i=1;i<=10;i++) { y = x - (f(x)/d(x)); x = y; } printf("\n The required root is: %f\n", x); getchar(); }