fork download
  1. PROGRAM Triangle
  2. REAL :: a, b, c, s, areasq, area
  3. WRITE (*,*) "This program calculates the area of a triangle"
  4. WRITE (*,*) "Type in the lenths of the three sides: "
  5. READ (*,*) a, b, c
  6. WRITE (*, *) "Check: you have input the following lengths: "
  7. WRITE (*, *) a, b, c
  8. s = 0.5 * (a+b+c) !Semiperimeter
  9. areasq = s * (s-a) * (s-b) * (s - c) ! square of area
  10. IF (areasq < 0.0) THEN
  11. WRITE (*.*) "Error, that is not a real triangle"
  12. ELSE
  13. area = SQRT(areasq)
  14. WRITE (*,*) "The area of the triangle is", area
  15. END IF
  16. END PROGRAM Triangle
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.f95:11.19:

           WRITE (*.*) "Error, that is not a real triangle"
                   1
Error: Syntax error in WRITE statement at (1)
stdout
Standard output is empty