Program in C Write a program in C to read a temperature in Fahrenheit and conver
ID: 3744176 • Letter: P
Question
Program in C
Write a program in C to read a temperature in Fahrenheit and convert it to centigrade. Then display a message saying it is boiling (if temp is greater than 212) or hot (if temp is greater than 90 F but below 212), or good (if temp is greater than 60 F but below 90) or (if temp is greater than 32 F but below 60) say it is cold, other than that it should say freezing. Use else if statements.
Explanation / Answer
#include int main() { float f, c; printf("Enter temperature in fahrenheit: "); scanf("%f", &f); c = (5.0/9) * (f - 32); printf("%f degrees fahrenheit is %f degrees centigrade ", f, c); if(f > 212) { printf("It is boiling "); } else if(f > 90) { printf("It is hot "); } else if(f > 60) { printf("It is good "); } else if(f > 32) { printf("It is cold "); } else { printf("It is freezing "); } return 0; }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.