fork download
  1. PROGRAM Circle
  2. !-------------------------------------------------------------------------------
  3. !Karl Harris ENGR225
  4. !January-20-2012
  5. ! ASSIGNMENT #1
  6. !
  7. !Program will calculate and display the radius, circumfrence, and area of a
  8. !circle whose diameter is chosen by the user.
  9. ! Input :Diameter
  10. !
  11. !Output : Radius, Circumfrence, Area
  12. !-------------------------------------------------------------------------------
  13.  
  14. IMPLICIT NONE
  15. Real :: Diameter, Radius, Circumfrence, Area, PI= 3.14159
  16.  
  17. ! Get Diameter
  18.  
  19. Write(*,*)"Please enter the diameter of your circle."
  20. Read(*,*) Diameter
  21.  
  22. !Calculate and write radius
  23. Radius= Diameter/2
  24. Write(*,*)"Radius=", Radius
  25.  
  26.  
  27. !Calculate and write circumfrence
  28. Circumfrence=2*PI*Radius
  29. Write(*,*)"Circumfrence=", Circumfrence
  30.  
  31. !Calculate and write area
  32. Area=PI*(Radius**2)
  33. Write(*,*)"Area=", Area
  34.  
  35. END PROGRAM Circle
  36.  
Success #stdin #stdout 0.01s 2620KB
stdin
10
stdout
 Please enter the diameter of your circle.
 Radius=   5.0000000    
 Circumfrence=   31.415901    
 Area=   78.539749