program regtriangle C******************************************************** C Read in the lengths of all 3 legs of a triangle and C compute the area and perimeter given Hero's theorum C******************************************************** real leg1, leg2, leg3 real area, perim, halfperim print *, 'Enter the lengths of the 3 sides of a triangle: ' read *, leg1, leg2, leg3 perim = leg1 + leg2 + leg3 halfperim = perim * 0.5 area = sqrt(halfperim * (halfperim - leg1) * + (halfperim - leg2) * (halfperim - leg3)) print *, 'The perimeter is: ', perim print *, 'The area is: ', area stop end