Hello, I just wrote my first code with a while loop and I am getting strange results. The program is supposed to give a Fahrenheit (TF) to Celsius (TC) conversion for every 5 degrees Fahrenheit increases between 0 and 100. It increases the value of TF just fine but in the results for TC it will only give the value -0 or 0. The odd thing is it changes from -0 to 0 when TF is high enough to make TC be positive. So I can't figure out why it won't let TC be any other number than 0
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
// Declare and initialize objects.
double TF, TC;
// Introduction.
cout << "Fahrenheit -> Celsius degree conversion table." << endl;
// Table creation.
TF=0;
while(TF<= 100)
{ TC= (TF-32)*(5/9);
cout << TF << " Becomes " << TC << endl;
TF= TF+5; }
}
Thank you for your time.