I have a homework and I need help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I have a homework and I need help

Write a program that converts integer Fahrenheit temperatures from 0 to 212 degrees to floating point Celsius temperatures with 3 digits of precision. perform the calculation using the formula ;(celsius = 5.0/9.0 * (fahrenheit - 32

25th Mar 2018, 8:08 PM
pomp
2 Answers
+ 3
I won't do your homework for you but I will list the steps the program should take... - Ask for input from user (if the homework task asks you to) - Store the Fahrenheit or Celsius value in a variable - Do the calculation - Print it out like.. printf("%f.3", yourVar);
25th Mar 2018, 8:20 PM
TurtleShell
TurtleShell - avatar
+ 3
/* Try it Now using SoloLearn Codeplayground!!! */ #include <stdio.h> int main() { int fahrenheit; float celsius; for(fahrenheit = 0; fahrenheit <= 212; fahrenheit++) { celsius = (fahrenheit - 32) * 5.0 / 9.0; printf(" \n %3d Fahrenheit = %.3f Celsius", fahrenheit, celsius); } return 0; }
25th Mar 2018, 8:41 PM
H. Ahmadian
H. Ahmadian - avatar