Write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows: F = (9/5) C + 32

Celsius to Fahrenheit Temperature Converter

Write a program that converts Celsius temperatures to Fahrenheit temperatures.

The formula is as follows:

F = (9/5) C + 32

The program should ask the user to enter a temperature in Celsius, and then display the temperature converted to Fahrenheit.

Solution

#Get the temperatures in Celsius

tempInCelsius = float(input(“Enter the temperatures in Celsius : “))

#convert temperature in celsius to Fahrenheit

celsiusToFahrenheit = ( ( (9 / 5 ) * tempInCelsius ) + 32 )

#displat the temperature Fahrenheit

print(“temperature converted to Fahrenheit is :”,celsiusToFahrenheit)