programming-examples/js/_Basic/Find the area of a triangle where lengths of the three of its sides are 5, 6, 7..js
2019-11-15 12:59:38 +01:00

6 lines
216 B
JavaScript

var side1 = 5;
var side2 = 6;
var side3 = 7;
var perimeter = (side1 + side2 + side3)/2;
var area = Math.sqrt(perimeter*((perimeter-side1)*(perimeter-side2)*(perimeter-side3)));
console.log(area);