      PROGRAM tasks                         ! illustrate use of subroutines
*     note how variables are passed
      IMPLICIT NONE
      REAL*8 product, sum, x, y
      CALL initial(x,y)                     ! initialize variables
      CALL add(x,y,sum)                     ! add two variables
      CALL multiply(x,y,product)
      WRITE(*,*) 'sum =', sum, '    product =', product
      END
C
      SUBROUTINE initial(x,y)
      IMPLICIT NONE
      REAL*8 x, y
      WRITE(*,'(A,$)') '? '
      READ(*,*) x
      WRITE(*,'(A,$)') '? '
      READ(*,*) y
      END
C
      SUBROUTINE add(x,y,sum)
      IMPLICIT NONE
      REAL*8 x, y, sum
      sum = x + y
      END
C
      SUBROUTINE multiply(x,y,product)
      IMPLICIT NONE
      REAL*8 x, y, product
      product = x*y
      END
