need help!! we are using c++ to program Write a program that will first allow a
ID: 3788694 • Letter: N
Question
need help!! we are using c++ to program
Explanation / Answer
#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;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.