summaryrefslogtreecommitdiff
path: root/1553/CH7/EX7.1/7Ex1.sce
diff options
context:
space:
mode:
Diffstat (limited to '1553/CH7/EX7.1/7Ex1.sce')
-rw-r--r--1553/CH7/EX7.1/7Ex1.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/1553/CH7/EX7.1/7Ex1.sce b/1553/CH7/EX7.1/7Ex1.sce
new file mode 100644
index 000000000..321f1365d
--- /dev/null
+++ b/1553/CH7/EX7.1/7Ex1.sce
@@ -0,0 +1,22 @@
+//Chapter 7 Ex1
+
+clc;
+clear;
+close;
+//let number be x
+//given x-36=86-x
+//thus polynomial is: 2x-122=0
+
+mycoeff=[-122 2];
+p=poly(mycoeff,"x","coeff");
+ans=roots(p);
+printf("The number is %d",ans);
+
+
+//Alternative logic for same problem
+for x=1:99
+ if((2*x-122)==0)
+ printf("\nAlternate Logic: \nThe number is: %d",x);
+ break;
+end
+end