Python Program to convert temperature in Celsius to Fahrenheit
Aim: Implement
a program to convert temperature in Celsius to Fahrenheit
Algorithm
1: start
2: read the temperature in centigrade
3: store the value in celsius
2: read the temperature in centigrade
3: store the value in celsius
4: set
farenheit to 32+ (1.8*celsius)
5: print value of celsius, farenheit
5: print value of celsius, farenheit
6: stop
Program:
# Input is provided by
the user in degree Celsius
# take input from the
user
celsius =
float(input('Enter degree Celsius: '))
# calculate fahrenheit
fahrenheit = (celsius *
1.8) + 32
print('%0.1f degree
Celsius is equal to %0.1f degree Fahrenheit' %(celsius,fahrenheit))
Output:
Enter degree Celsius:
37.5
37.5 degree Celsius is
equal to 99.5 degree Fahrenheit
0 Comments:
Post a Comment