Answer to Question #140131 in C++ for hussnain ali

Question #140131
write a program to convert temperature from cemtigrate to fahrenheit
1
Expert's answer
2020-10-25T19:33:12-0400
#include<iostream>
using namespace std;
 
int main()
{
    float centigrade, fahrenheit;   //Variable declaration
    cout << "Enter the temperature in Centigrade : "; 
    cin >> centigrade;  //prompt to input temparature
    fahrenheit = (centigrade * 9.0) / 5.0 + 32; //formula to convert to fahrenheit
    cout << "The temperature in Celsius    : " << centigrade << endl;
    cout << "The temperature in Fahrenheit : " << fahrenheit << endl;   //output the result
    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