PROGRAM Triangle IMPLICIT NONE LOGICAL l1, l2 INTEGER side1, side2, side3 PRINT*, "Type in the three sides:" READ*, side1, side2, side3 IF (2*MAX(side1,side2,side3) .GE. side1+side2+side3) THEN PRINT*, "Not a Triangle" ELSE l1 = side1 .EQ. side2 l2 = side2 .EQ. side3 IF (l1 .AND. l2) THEN PRINT*, "Equilateral" ELSE IF (l1 .OR. l2 .OR. side1 .EQ. side3 ) THEN PRINT*, "Isosoles" ELSE PRINT*, "Scalene" END IF END IF END IF END PROGRAM Triangle
The results are