FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 202   



Following program shows you how to convert fahrenheit to celsius.
In this program we get fahrenheit temperature from user and convert that fahrenheit temperature into celsius using following formula
Celsius = (fahrenheit - 32) * 5 / 9

 puts "Please enter temperature in fahrenheit:"
 temperature = gets.to_f
 celsius = (temperature - 32) * 5 / 9
 puts "Temperature in celsius: #{celsius}"

Output:

Please enter temperature in fahrenheit:
77
Temperature in celsius: 25.0



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News