cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c area.f: Area of a circle, sample program c
c c
c taken from: "Projects in Computational Physics" by Landau and Paez c
c copyrighted by John Wiley and Sons, New York c
c c
c written by: students in PH465/565, Computational Physics, c
c at Oregon State University c
c code copyrighted by RH Landau c
c supported by: US National Science Foundation, Northwest Alliance c
c for Computational Science and Engineering (NACSE), c
c US Department of Energy c
c c
c UNIX (DEC OSF, IBM AIX): f77 area.f c
c c
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
Program area
c
c area of circle, r input from terminal
Double Precision pi, r, A
c
c Best value of pi for IEEE floating point
pi = 3.1415926535897932385E0
c
c read r from standard input (terminal)
Write(*,*) 'Enter the radius of a circle'
Read (*,*) r
c
c calculate area
A = pi * r**2
c
c write area onto terminal screen
Write(*, 10) 'radius r =', r, 'area =', A
10 Format(a10, f10.5, a10, f12.5)
Stop 'area'
End