! This is the same program as the triangle program without
! (most of) the comments. It will compile and run the same
! as the commented version.
MODULE const
INTEGER, PARAMETER :: dp = KIND(1.0d0), sp = KIND(1.0e0)
REAL(KIND=dp), PARAMETER :: dpi = 3.141592653589793d0
END MODULE const
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
PROGRAM triangle
USE const
IMPLICIT NONE
! This is a simple program to compute the area of a triangle given
! the base and height
!
REAL(KIND=dp) :: base,height,area
WRITE(*,*) 'Input the base'
READ(*,*) base
WRITE(*,*) 'Input the height'
READ(*,*) height
area = base*height/2
WRITE(*,*) 'The area of the triangle is = ',area
END PROGRAM triangle
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Sample Runs
! Input the base
! 1.0d0
! Input the height
! 6.0d0
! The area of the triangle is = 3.00000000000000
!
! Input the base
! 0.5d0
! Input the height
! 10.0d0
! The area of the triangle is = 2.50000000000000