#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;
}
Comments
Leave a comment