PROGRAM Example
   IMPLICIT NONE

   INTEGER :: a, b, c 

   a = 10 
   b = 5 
   c = 13
   WRITE(*,*) Small(a, b, c)         ! part I
   WRITE(*,*) Small(a+b, b+c, c)     ! part II
   WRITE(*,*) Small(1, 5, b)         ! part III
   WRITE(*,*) Small((a), (b), (c))   ! part IV

CONTAINS

INTEGER FUNCTION Small(x, y, z)
   IMPLICIT NONE
   INTEGER, INTENT(IN) :: x, y, z
   
   IF ( x <= y .AND. x <= z) THEN
      Small = x
   ELSE IF (y <= x .AND. y <= z) THEN
      Small = y 
   ELSE 
      Small = z
   END IF
END FUNCTION Small
END PROGRAM Example
