I'm trying to write a program where the user gets to convert from Fahrenheit to Celsius or Celsius to Fahrenheit. When I run the program I enter 68 and it returns with -17.78 instead of 20 like it should.
I looked through lots of different forums and the only solution I could find was changing the data type from integer to double but I already did that.
double temp;
printf("Input temperature in degrees Fahrenheit:");
scanf("%.2f", &temp);
temp = (5.0f/9.0f)*(temp-32.0f);
printf("The temperature in Celsius is %.2f.", temp);
return 0;
On paper it seems to me like everything is correct is there something I am missing?