I just started C++ two days ago. I am having a slight problem. When I give the input- 97 Fahrenheit, I get the output as 36 Celsius instead of 36.11, having declared TempC as float type.
using namespace std;
cout <<"Enter the Temperature in Fahrenheit: ";
cin >> TempF;
TempC = (TempF-32)*5/9;
cout <<"The Temperature on Celcius scale is "<< TempC << endl;
Last edited on
it can be either a float or a double. int is a straight integer, and will only be displayed as a integer and the .011 will not be a part, whereas with a float or double the decimal part is included.
lol, i always had problem with english.
Don't think "Fahrenheit" counts as english.