13 lines
383 B
Plaintext
13 lines
383 B
Plaintext
fromKelvin = function(temp)
|
|
print temp + " degrees in Kelvin is:"
|
|
Celsius = temp - 273.15
|
|
print Celsius + " degrees Celsius"
|
|
Fahrenheit = round(Celsius * 9/5 + 32,2)
|
|
print Fahrenheit + " degrees Fahrenheit"
|
|
Rankine = Fahrenheit + 459.67
|
|
print Rankine + " degrees Rankine"
|
|
end function
|
|
|
|
temp = input("Enter a temperature in Kelvin: ")
|
|
fromKelvin temp.val
|