summaryrefslogtreecommitdiff
path: root/1553/CH4/EX4.38/4Ex38.sce
blob: dee0c654565d78104fe56199e9de169e2ce0acc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//chapter 4 Ex 38

clc;
clear;
close;
x=poly(0,'x');
AtoS=30; StoA=10;
y=2*x-(AtoS+2*AtoS);        //equation 1
y=(x+AtoS+StoA)/3;    //equation 2
for x=1:99
  if  2*x-(AtoS+2*AtoS)==(x+AtoS+StoA)/3
    break
  end
end
y=(x+AtoS+StoA)/3;
printf("Arun has Rs.%d and Sajal has Rs.%d",x,y);