Java Program to Convert Celsius into Fahrenheit
Celsius scale is a temperature scale that is based on the freezing point of water at 0 °C and the boiling point of water at 100 °C. Fahrenheit scale is a temperature scale that has a freezing point of water at 32 °F and the boiling point of water at 212 °F.
Input : 0 Output: 32 Input :-40 Output:-40
- Initializing value of celsius as 10.0 and Fahrenheit value as 0.0
- Calculate the Fahrenheit using the below formula
- Display Fahrenheit.
Below is the implementation of the above approach:
value of temperature in fahrenheit:50.0
Time Complexity: O(1)
Space Complexity: O(1)
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.