Convert Fahrenheit to Celsius

Learn to convert a string into a float and use this information to convert Fahrenheit to Celsius.

Problem

Here's the formula to convert Fahrenheit to Celsius:

            Tc=59(Tf−32)T_c = \cfrac{5}{9}(T_f-32)

Write a program to convert the temperature given in Fahrenheit to Celsius.

  • Assume that the value of the temperature in Fahrenheit is available to your program in a string, input.

  • The temperature in Celsius should be rounded to two digits after the decimal point and saved in a variable called output.

Get hands-on with 1400+ tech skills courses.