The question that keeps arising time and time again is the following, "Why is the code not properly displaying the accurate results?"
I have searched similar coding and they are no less or different than the one I present before you. I've tried different methods and data types; however, I get numbers either being a constant zero or 1 degrees in Fahrenheit being -17.92, when the following result should be played near the zero value. Yet, the following value for zero is 2.58e+267, resulting a value close to 268. In addition, I had a following error that stated that zero cannot be read in the function. It may be the Dev-Cpp compiler, the sensitivity during the programming, or the user unable to comprehend a simple task. Nonetheless, if anyone is capable of aiding my issue, I appreciate it.
The following code is the recent design and the previous have been overwritten with constant: trail and error, research, reading and analysis, as well as a hard copy (i.e written by hand).
Since f is an integer type, ((f-32)*5)/9 does integer division, so the result will always be an integer.
The easiest way to fix that is to change one of the constants to a floating-point value, like ((f-32)*5)/9.0 for instance.
Also, your for loop is really confusing. It seems like it increments f, then prints the previous value of temperatureC (which, by the way, will be a garbage value during the first loop iteration since it hasn't been set yet, which is why you're getting a garbage value for f=0).
Then because of the for loop, f gets incremented again, which is why it skips every other value.
Try moving line 21 above line 20 and change that f++ on line 20 to just f.
Thanks. Also, I apologize for not adding #include <iomanip>, forgot placing the thing up there when I was typing it down. Anyway, I've modified the code and ran a few tests. The digit required being changed in decimal form. In addition to, a little bit of clean up like you suggested: