! Program Example from "Essential Fortran 90 & 95" by Loren P. Meissner
! Copyright 1996. Copying for sale requires permission from the author.
! Otherwise, distribution is permitted if these three lines are included.

! Example 3.4. Rank two numbers.
  program D04
    implicit none
    real :: X, Y
    character (len = 7) :: X_Rank, Y_Rank
! start program D04
    write (unit = *, fmt = *) " Please enter a pair of real numbers to be ranked. "
    read (unit = *, fmt = *) X, Y
    write (unit = *, fmt = *) " You have entered: ", X, Y
    if (X > Y) then
      X_Rank = "larger "
      Y_Rank = "smaller"
    else
      X_Rank = "smaller"
      Y_Rank = "larger "
    end if
    write (unit = *, fmt = *) X, " is ", X_Rank, " and ", Y, " is ", Y_Rank
    stop
  end program D04
