I am trying to fix a program that converts a temperature in degree Celsius to de
ID: 441847 • Letter: I
Question
I am trying to fix a program that converts a temperature in degree Celsius to degree Fahrenheit. I keep getting an incorrect output for degree Fahrenheit. When I input 65.0 for an example, I get 32.0037. Any help.This is what the program looks like: #include using namespace std; int main () { double fahr; double cent; cout << "Please enter a Centigrade temperature for conversion." << endl; cin >> cent; fahr = (9.0/5.0)*(cent +32); cout << "degrees Centigrade = " << cent << endl; cout << "degrees Fahrenheit = " << fahr << endl; return 0;Explanation / Answer
/** your code is perfect. there is no wrong in it **/
I run it on online c++ compiler and gave input 65.0 C and it gave the right answer(174.6 F)....here is the link . check this:
http://ideone.com/NxFTAT
/** the code **/
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.