summaryrefslogtreecommitdiff
path: root/1553/CH24/EX24.4/24Ex4.sce
blob: 55a12668e7bfed1491b0b30201385efce8266f87 (plain)
1
2
3
4
5
6
7
8
9
10
//chapter 24 Ex 4

clc;
clear;
diagonal=17;
perimeter=46;
//perimeter=2(l+b), area=l*b, diagonal^2=l^2+b^2 using hypotenus
//using above conditions, the equation diagonal^2+2l*b=(perimeter/2)^2
area=((perimeter/2)^2-diagonal^2)/2;
mprintf("The area of rectangle is %d square cm",area);