! 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.

! Exercises 2.3, Number 12.
  program C3X12
    implicit none
    real, parameter :: A = 16.0, B = 4.0, C = 0.25, Theta = -0.5, X = 4.0
    integer, parameter :: I = 1, J = -256, L = 4, M = 17, N = 8, Minute = 61
! start program C3X12
    write (unit = *, fmt = *) abs( A ) * B / C
    write (unit = *, fmt = *) sqrt( real( ((M - 9) / L) * N ) )
    write (unit = *, fmt = *) A * sign( Theta, 1.0 )
    write (unit = *, fmt = *) 0.5 * (sqrt( X ) + A / sqrt( X ))
    write (unit = *, fmt = *) abs( I - 5 )
    write (unit = *, fmt = *) modulo( Minute, 60 )
    write (unit = *, fmt = *) max( abs( I - 5 ), I, 1 )
    write (unit = *, fmt = *) sqrt( sqrt( A ) )
    write (unit = *, fmt = *) sqrt( B ** 2 - 4.0 * A * C ) / (2.0 * A)
    write (unit = *, fmt = *) 1 + nint( sqrt( real( abs( J ) ) ) )
    stop
  end program C3X12

