53.6k views
15 votes
Write a program that asks the user for a temperature in degrees Celsius.

Then display the temperature in Celsius and its Fahrenheit equivalence to two decimal places.

1 Answer

13 votes

Answer:

#include <iostream>

#include <iomanip>

using namespace std;

int main(){

double celsius, fahrenheit

cout << "Enter the emperature in degrees Celsius: ";

cin >> celsius;

cout << endl;

fahrenheit = (celsius * 9/5) + 32;

cout << fixed << setprecision(2) << fahrenheit;

}

Step-by-step explanation:

User Nico Toub
by
3.7k points