VOOZH about

URL: https://www.geeksforgeeks.org/dsa/program-celsius-fahrenheit-conversion/

⇱ Program for Celsius To Fahrenheit conversion - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Program for Celsius To Fahrenheit conversion

Last Updated : 30 Aug, 2025

Given a Temperature C on the Celsius scale, we need to convert it into a Fahrenheit scale.

Examples: 

Input: 0
Output: 32
Explanation: Using this Conversion formula T(°F) = T(°C) × 9/5 + 32 . we get temperature on Fahrenheit scale from Celsius.

Input: -40
Output: -40
Explanation: Using the Conversion formula T(°F) = (-40)× 9/5 + 32 . So temperature in Fahrenheit is -40

The formula for converting the Celsius scale to the Fahrenheit scale is: 
 T(°F) = T(°C) × 9/5 + 32


Output
68

Time Complexity: O(1)
Auxiliary Space: O(1)

Comment