So everything seems to be working fine here, but after the first calculation that converts 0C to 32F, it just adds increments of 1 to each Fahrenheit. Why isn't the formula being repeated for each increasing value of Celcius? Help would be greatly appreciated, as I have spent hours trying to figure this out.
Code:# include <iostream> # include <iomanip> using namespace std; int main() { double c; cout << setw(4) << "Celcius" << setw(7) << "" << "Fahrenheit" << endl; for (c = 0; c <= 20; c++) { double f = (9/5) * c + 32; cout << setw(4) << c << setw(7) << " " << " " << " " << " " << f << endl; } return 0; }





Reply With Quote