fork download
  1. PROGRAM Temperature_Conversion
  2. !----------------------------------------------------------------------------------------------
  3. ! Program to convert a temperature on the Celsius cale to the
  4. ! corresponding temperature on the Fahenheit scale.
  5. ! Variables used are:
  6. ! Calsius : temperature on the Calsius scale
  7. ! Fahrenheit : temperature on the Fahenheit scale
  8. !
  9. ! Input: Celsius
  10. ! Output: Fahrenheit
  11. !----------------------------------------------------------------------------------------------
  12.  
  13. IMPLICIT NONE
  14. REAL :: Celsius, Fahrenheit
  15.  
  16. ! Obtein Celsius temperature
  17. PRINT *, "Enter temperature in degrees Celsius:"
  18. READ *, Celsius
  19.  
  20. ! Calculate corresponding Fahrenheit temperature
  21. Fahrenheit = 1.8 * Celsius + 32.0
  22.  
  23. ! Display temperatures
  24. PRINT *, Celsius, "degrees Celsius =", &
  25. Fahrenheit, "degrees Fahrenheit"
  26.  
  27. END PROGRAM Temperature_Conversion
  28.  
Runtime error #stdin #stdout 0.02s 2620KB
stdin
Standard input is empty
stdout
 Enter temperature in degrees Celsius: