PPT Slide
! Example P.4. Prompting for terminal keyboard input.
real :: X, Y, Average, Diameter, Fahr, Cels
real, parameter :: T_SCALE = 1.8, OFFSET = 32.0
write (unit = *, fmt = *) " Please enter two numbers to be averaged. "
read (unit = *, fmt = *) X, Y
write (unit = *, fmt = *) " The average of ", X, " and ", Y, " is: ", Average
write (unit = *, fmt = *) " Please enter the diameter of a circle. "
read (unit = *, fmt = *) Diameter
write (unit = *, fmt = *) " Circumference: ", atan2( 0.0, -1.0 ) * Diameter
write (unit = *, fmt = *) " Please enter the Fahrenheit temperature. "
read (unit = *, fmt = *) Fahr
Cels = (Fahr - OFFSET) / T_SCALE
write (unit = *, fmt = *) Fahr, " deg. F = ", Cels, " deg. C "