1 2 3 4 5 6 7 8 9 10
//chapter 6 Ex 10 clc; clear; close; n=3; avg=45; AB=40; BC=43; Sum=(avg*n); SumAB=AB*2; SumBC=BC*2; B=SumAB+SumBC-Sum; mprintf("The weight of B is %d kg.",B);