To take temperature in Celsius as float type from user and convert into Fahrenheit.
[ SUBJECT ARTIFICIAL INTELLIGENCE, PYTHON, CLASS 9th ]
DON'T SPAM IF YOU DON'T KNOW!
Answers
Answered by
0
Answer:
temp = float(input("Enter Temperature: "))
unit = input("Enter unit('C' for Celsius or 'F' for Fahrenheit): ")
ans .
this is coding,
if unit == 'C' or unit == 'c' :
newTemp = 9 / 5 * temp + 32
print("Temperature in Fahrenheit =", newTemp)
elif unit == 'F' or unit == 'f' :
newTemp = 5 / 9 * (temp - 32)
print("Temperature in Celsius =", newTemp)
else :
print("Unknown unit", unit).
plls give me thanks
Answered by
0
Answer:
- #include<stdio.h>
- int main()
- {
- float fahrenheit, celsius;
- celsius = 24;
- fahrenheit =( (celsius*9)/5)+32;
- printf("\n\n Temperature in fahrenheit is: %f",fahrenheit);
- return (0)
Mark as Brainliest!
Similar questions