c programming for raphson method

#include<stdio.h>
#include<math.h>
#define f(x) (3*x*x+2*x-9)
#define df(x) (6*x+2)

void main()
{
float x,a,c;

printf(“n Enter the value initial value of xn”);
scanf(“%f”,&x);
do
{
c=(-f(x)/df(x));
x=x+c;
}
while (fabs(c)>0.0001);
printf(“n The value of the root is=%f”,x);
}

output:-
Enter the initial value of x
The value of the root is =1.430501

Leave a Comment

Your email address will not be published. Required fields are marked *

To Resolve this issue at just 5$ from ServerExpert

https://serverexpert.io/

For Hosting please visit Hostingwebsite.io

You have Successfully Subscribed!

Open chat