Answer to Question #123398 in C++ for rahul deo

Question #123398
Write a program that reads a Celsius degree in a double value from the console, then converts it to Fahrenheit and displays the result. The formula for the conversion is as follows:
fahrenheit = (9 / 5) * celsius + 32

Hint: In C++, 9 / 5 is 1, but 9.0 / 5 is 1.8.
1
Expert's answer
2020-06-22T09:18:17-0400
#include <iostream>
using namespace std;

int main()
{
    double celsiusDegree;
    cout << "Enter celsius degree: ";
    cin >> celsiusDegree;


    double fahrenheitDegree = (9.0/5)*celsiusDegree + 32;
    cout << "Fahrenheit: " << fahrenheitDegree << endl;
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS