Advertisement
SilverCrow23

ConvertKelvin

Jan 15th, 2020
2,021
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       program ConvertKelvin
  2.       implicit none
  3.      
  4.       ! -----------------------------------------------Declare
  5.       real tempC, tempK, ZERO_SHIFT
  6.       parameter (ZERO_SHIFT = 273.15)
  7.      
  8.  
  9.       ! -----------------------------------------------Input
  10.       print*, "Enter the temperature in Celsius ..."
  11.       read*, tempC
  12.  
  13.       ! -----------------------------------------------Compute
  14.       tempK = (tempC + ZERO_SHIFT)
  15.  
  16.  
  17.  
  18.       ! -----------------------------------------------Output
  19.       print*, "The corresponding Kelvin temperature is "
  20.       print*, tempK, " degrees"
  21.       end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement