summaryrefslogtreecommitdiff
path: root/1553/CH8/EX8.3/8Ex3.sce
diff options
context:
space:
mode:
Diffstat (limited to '1553/CH8/EX8.3/8Ex3.sce')
-rw-r--r--1553/CH8/EX8.3/8Ex3.sce14
1 files changed, 14 insertions, 0 deletions
diff --git a/1553/CH8/EX8.3/8Ex3.sce b/1553/CH8/EX8.3/8Ex3.sce
new file mode 100644
index 000000000..c133469ab
--- /dev/null
+++ b/1553/CH8/EX8.3/8Ex3.sce
@@ -0,0 +1,14 @@
+//chapter 8 Ex 3
+
+clc;
+clear;
+close;
+//let ankita's age be x, thus nikita'a age=240/x
+//by the given condition: 2*240/x-x=4; equation is: x^2+4*x-480;
+mycoeff=[-480 4 1];
+p=poly(mycoeff,"x","coeff");
+ageAnkita=roots(p);
+ageNikita=240/ageAnkita(2);//since age cannot be negative
+printf("Age of Nikita is %d years",ageNikita);
+
+