fork download
  1. !George Austin Corbett
  2. !Extra Credit Problem 1.4.5
  3. PROGRAM Circle_Calculator
  4.  
  5. IMPLICIT NONE
  6. REAL:: diameter, radius, circumference, area
  7.  
  8. WRITE(*,*) "Enter the diameter of the circle: "
  9. READ *, diameter
  10. WRITE(*,*) "" ! This just prints a line to make it look pretty
  11.  
  12. !Calculate and print radius
  13. radius = diameter * 0.5
  14. WRITE(*,*) "The radius of this circle is: " ,radius
  15.  
  16.  
  17. !Calculate and print circumference
  18. circumference = 2 * 3.141592653 * radius
  19. WRITE(*,*) "The circumference of this circle is: " , circumference
  20.  
  21. !Calculate and print area
  22. area = 3.141592653 * radius * radius
  23. WRITE(*,*) "The area of the circle is: " , area
  24.  
  25. END PROGRAM Circle_Calculator
  26.  
Success #stdin #stdout 0.01s 2620KB
stdin
100
stdout
 Enter the diameter of the circle: 
 
 The radius of this circle is:    50.000000    
 The circumference of this circle is:    314.15927    
 The area of the circle is:    7853.9819