! 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 2.12. Simple sort with module subroutine Swap.
  program C12
    use Swap_Reals_M
    implicit none
    real :: A, B, C
! start program C12
    write (unit = *, fmt = *) " Please enter three numbers."
    read (unit = *, fmt = *) A, B, C
    write (unit = *, fmt = *) " Thank you. You have entered: ", A, B, C
    if (A > B) then
      call Swap( A, B )
    end if
    if (A > C) then
      call Swap( A, C )
    end if
    if (B > C) then
      call Swap( B, C )
    end if
    write (unit = *, fmt = *) " The numbers in increasing order are: ", A, B, C
    stop
  end program C12
