summaryrefslogtreecommitdiff
path: root/1553/CH7/EX7.8/7Ex8.sce
diff options
context:
space:
mode:
Diffstat (limited to '1553/CH7/EX7.8/7Ex8.sce')
-rw-r--r--1553/CH7/EX7.8/7Ex8.sce15
1 files changed, 15 insertions, 0 deletions
diff --git a/1553/CH7/EX7.8/7Ex8.sce b/1553/CH7/EX7.8/7Ex8.sce
new file mode 100644
index 000000000..fed94530a
--- /dev/null
+++ b/1553/CH7/EX7.8/7Ex8.sce
@@ -0,0 +1,15 @@
+////Chapter 7 Ex 8
+clc;
+close;
+
+//Let first number be x, thus other numbers will be x+2,x+4,x+6 (since consecutive even); and the equation will be (sum/4)=27
+
+//sum=x+(x+2)+(x+4)+(x+6);
+//avg=27; //given
+//avg=sum/4;
+// given polynomial is x+(x+2)+(x+4)+(x+6)=108
+
+mycoeff=[-96 4];
+p=poly(mycoeff,"x","coeff");
+r=roots(p)+6;
+printf("The largest number is: %d",r)