C program to convert Fahrenheit to Celsius always prints zero

后端 未结 7 1003
无人及你
无人及你 2020-11-22 07:09

I need some help with a program for converting Fahrenheit to Celsius in C. My code looks like this

#include 
int main(void)
{
    int fahrenhe         


        
7条回答
  •  难免孤独
    2020-11-22 07:56

    You need to use floating point arithmetic in order to perform these type of formulas with any accuracy. You can always convert the final result back to an integer, if needed.

提交回复
热议问题