PROGRAM Triangle
REAL :: a, b, c, s, areasq, area
WRITE (*,*) "This program calculates the area of a triangle"
WRITE (*,*) "Type in the lenths of the three sides: "
READ (*,*) a, b, c
WRITE (*, *) "Check: you have input the following lengths: "
WRITE (*, *) a, b, c
s = 0.5 * (a+b+c)   !Semiperimeter
areasq = s * (s-a) * (s-b) * (s - c)  ! square of area
IF (areasq < 0.0) THEN
           WRITE (*.*) "Error, that is not a real triangle"
    ELSE
           area = SQRT(areasq)
WRITE (*,*) "The area of the triangle is", area
END IF
END PROGRAM Triangle