summaryrefslogtreecommitdiff
path: root/149/CH24/EX24.6/ques7.sce
diff options
context:
space:
mode:
Diffstat (limited to '149/CH24/EX24.6/ques7.sce')
-rwxr-xr-x149/CH24/EX24.6/ques7.sce20
1 files changed, 20 insertions, 0 deletions
diff --git a/149/CH24/EX24.6/ques7.sce b/149/CH24/EX24.6/ques7.sce
new file mode 100755
index 000000000..b117f3f66
--- /dev/null
+++ b/149/CH24/EX24.6/ques7.sce
@@ -0,0 +1,20 @@
+//ques 7
+clear
+clc
+disp('To find squareroot of 28 by newtons method let x=sqrt(28) ie x^2-28=0');
+function y=f(x)
+ y=x^2-28;
+endfunction
+disp(' To find the roots by newtons method ');
+disp('f(5)=-ve and f(6) is +ve so a root lies between 5 and 6');
+l=5;
+m=6;
+disp('let us take x0=5.5');
+disp("Root is given by rn=xn-f(xn)/der(f(xn)) ");
+disp('approximated root in each steps are');
+x0=5.5;
+for i=1:4
+ k=x0-f(x0)/derivative(f,x0);
+ disp(k);
+ x0=k;
+end \ No newline at end of file