// JavaScript program to find the area of a triangle
      const side1 = parseInt(prompt('Enter side1: '));
      const side2 = parseInt(prompt('Enter side2: '));
      const side3 = parseInt(prompt('Enter side3: '));
      // calculate the semi-perimeter
      const s = (side1 + side2 + side3) / 2;
      //calculate the area
      const areaValue = Math.sqrt(
        s * (s - side1) * (s - side2) * (s - side3)
      );
      console.log(
        `The area of the triangle is ${areaValue}`
      );
      
      Javascript language logo

      Known Sides

      0

      0

      avatar
      natalie19970

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.