summaryrefslogtreecommitdiff
path: root/1553/CH7/EX7.8/7Ex8.sce
blob: fed94530aa8af2591a3e718fda480f13cf212527 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)