# /*Newton Raphson Method

*/
#include<stdio.h>
#include<math.h>
#define e .00001
#define F(X) (x)*(x)-3*(x)+2
#define Fd(x) 2*(x)-3
void main(void) {
double x1,x2,f,fd,root,equvalue;
printf("Enter the initial root");
scanf("%1f",&x1);
f=F(x1);
fd=Fd(x1);
again:
printf("x1: %f\t",x1);
x2=x1-(f/fd);
printf("x2: %f\n",x2);
if(fabs(x2-x1)>e){
x1=x2;
f=F(x1);
fd=Fd(x1);
goto again;
}
else root = x2;
printf("The root is: %1f\n",root);
equvalue=F(root);
printf("Value of F(root) is: %1f",equvalue);
}

r2=r1-(f/fd). fd=Fd(r1).00001 #define mt ((1.(-3)))*(((mb)*(2/(3.4))) #define ac ((4)*(pow(10. if(fabs(r2-r1)>e){ r1=r2.f.(-3)))*(mc)*((1/ ((ac)+(r)))-((ac)/(pow(((ac)+(r)).(-3)))*(mb)*(2/(3.2)))) #define F4 (1)/( pow((r).root).3))) #define F(r) (F1+F2+F3+F4)-(0.14))*((ab)/(pow((ab).equvalue.h> #include<math.1)*(pow(10.14)))*((1.6163) #define F1 (-2)*(pow((r).(-2)))*(mc)*(((1)*(pow(((ac)+(r)). printf("r2: %f\n".(-2)))) #define f7 (-2)*(pow((r).14))*(ab)*(-1)*(pow((((ab)*(ab))+((r)*(r))).14))*(ab)*((-1)/((pow((ab).33)))) #define ab ((3)*(pow(10.12)))*((1.2)+(pow((r).h> #define e . again: printf("r1:%f\t".2)))*(pow((ab).h> #include<conio.(3))*(mc)*((pow(((ac)+(r)).(-2))))-((ac)*(-2)*(pow(((ac)+(r))).14))*((ab)/(pow((ab).r1).(-3)))*(((mb)*(2/(3.14))*(atan((r)/(ab)))+(mc)*((log((ac)+(r))-log(ac)-(1)+((ac)/((ac)+ (r)))) #define F2 (-2)*(pow((r).-2))*((mb)*(2/(3.(-1)))-((ac)*pow(((ac)+(r)).equvalue).(-4)))*((mc)*((log((ac)+(r)))-(log(ac))-(1)+((ac)/((ac)+(r))))-(-2)*pow((r). } .5))) #define f5 (-2)*(-3)*(pow((r). printf("Enter the initial root").-2))*(mb)*(2/(3.fd.2)))) #define Fd(r) f5+f6+f7+f8 void main(void){ double r1. &r1).(-4)))*(mb)*(2/(3.(-2)))*(mc)*((1/((ac)+(r)))-(((2)*(ac))/(pow(((ac)+(r)). f=F(r1).2)+(pow((r).2))))) #define F3 (1)/(pow((r).99)*(pow(10.2)))))(pow((r).99)*(pow(10.14))*((ab)/(((ab)*(ab))+((r)*(r))))+(pow((r)./*Newton Rapson Method*/ #include<stdio. printf("The root is:%lf\n".33)))) #define mc (((1. printf("Value of F(root) is: %lf".(-2)))*(mb)*(2/ (3.2))))+(-2)*(pow((r). scanf("%lf".r2.2)+(pow((r). equvalue=F(root). goto again.99)*(pow(10. fd=Fd(r1).r2).33))) #define mb (((2)*(pow(10.(-3)))*(mc)*((1/((ac)+(r)))-((ac)/(((ac)+(r))*((ac)+(r)))))+(pow((r).(-3)))*(mc)*(((1/ (( ac)+(r)))-((ac)/(pow(((ac)+(r)).root.14))*((ab)/ (((ab)*(ab))+((r)*(r)))) #define f6 (-2)*(-3)*(pow((r). f=F(r1).2)))))+(-2)*(pow(r. } else root=r2.14))*((atan((r)/(ab)))-((2)/(pow((r).2)+(pow((r).(-2)))*(2)*(r) #define f8 (-2)*(pow((r).(-3)))*(mb)*(2/(3.