! 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.5. Assignment statements with exponentiation.
  program C05
    implicit none  ! Type declarations
    real, parameter :: Base = 2.78, Exp_Value = 5.0
    real, parameter :: Length = 12.0, Width = 3.0, Height = 4.0
    real, parameter :: A = 5.0, B = 8.0, C = 3.0
    real :: R_Power, Diagonal, Discriminant, Root
    integer, parameter :: I = 2, E = 10
    integer :: I_Power
! start program C05
    R_Power = Base ** Exp_Value  ! Assignment statements
    Diagonal = (Length ** 2 + Width ** 2 + Height ** 2) ** 0.5
    Discriminant = B ** 2 - 4.0 * A * C
    Root = (-B + Discriminant ** 0.5) / (2.0 * A)
    I_Power = I ** E
    write (unit = *, fmt = *) R_Power, Diagonal, Discriminant, Root, I_Power
    stop
  end program C05
