need help we are using c to program Write a program that wil
need help!! we are using c++ to program
Solution
#include <iostream>
using namespace std;
int main()
{
cout<<\"1. Convert a temperature from degrees Celsius to degrees Fahrenheit.\"<<endl;
cout<<\"2. Convert a temperature from degrees Fahrenheit to degrees Celsius.\"<<endl;
cout<<\"Select one of the options:\";
int op;
double temp;
cin>>op;
cout<<\"Enter a temperature:\";
cin>>temp;
if(op==1)
{
cout<<\"The temperature in Fahrenheit is \"<< temp*1.8+32<<endl;
}
else
{
cout<<\"The temperature in Celsius is \"<< (temp-32.0)/1.8 <<endl;
}
return 0;
}
