Python Program to Convert Celsius to Fahrenheit


This is a Python Program to take the temperature in Celsius and convert it to Fahrenheit.

Problem Description

The program takes the temperature in Celsius and converts it to Fahrenheit.

Problem Solution

1. Take the value of temperature in Celsius and store it in a variable.
2. Convert it to Fahrenheit.
3. Print the final result.
4. Exit.

Program/Source Code

Here is source code of the Python Program to take the temperature in Celsius and convert it to Fahrenheit. The program output is also shown below.

celsius=int(input("Enter the temperature in celcius:"))
print("Temperature in farenheit is:",f)
Program Explanation

1. User must first enter the value of temperature in Celsius.
2. Using the formula of: f=(c*1.8)+32, convert Celsius to Fahrenheit.
3. Print the temperature in Fahrenheit.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
Runtime Test Cases
Case 1:
Enter the temperature in celcius:32
Temperature in Fahrenheit is: 89.6
Case 2:
Enter the temperature in celcius:48
Temperature in Fahrenheit is: 118.4

Sanfoundry Global Education & Learning Series – Python Programs.

To practice all Python programs, here is complete set of 150+ Python Problems and Solutions.

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & technical discussions at Telegram SanfoundryClasses.