Created
December 26, 2016 18:28
-
-
Save martinium/1d43e2f7517d115d15510f2df68542fe to your computer and use it in GitHub Desktop.
Temp converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fahrToCels(fahr : Number) | |
celsius = 5 * (fahr - 32) / 9 | |
puts "The temperature #{fahr} Fahrenheit is #{celsius} in Celsius degrees." | |
end | |
input = STDIN.gets.to_i | |
fahrToCels(input) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment