Newton Raphson Method C Programming Code, C Programming

About Newton Raphson Method: Newton-Raphson method, also known as the Newton’s Method, is the simplest and fastest approach to find the root of a function. It is an open bracket method and requires only one initial guess. The C program for Newton Raphson method presented here is a programming approach which can be used to find the real roots of not only a nonlinear function, but also those of algebraic and transcendental equations. source :
Programme Code:

float f(float x)
    return x*log10(x) - 1.2;
float df (float x)
    return log10(x) + 0.43429;
void main()
    int itr, maxmitr;
    float h, x0, x1, allerr;
    printf("\nEnter x0, allowed error and maximum iterations\n");
    scanf("%f %f %d", &x0, &allerr, &maxmitr);
    for (itr=1; itr<=maxmitr; itr++)
        printf(" At Iteration no. %3d, x = %9.6f\n", itr, x1);
        if (fabs(h) < allerr)
            printf("After %3d iterations, root = %8.6f\n", itr, x1);
            return 0;
    printf(" The required solution does not converge or iterations are insufficient\n");
    return 1;
Newton Raphson Method, Newton Raphson Method with C Programming Code, C Programming , Math Programming using c Language


Post a Comment


Feature Article

Popular Posts

Recommended Article

Live cricket