摄氏温度转换为华氏温度超时
#include<iostream.h>
#include<conio.h>
#include<conio.h>
void main()
{
clrscr(); //to clear the screen
float temp,res;
int choice;
cout<<“Temperature Conversion”<<“nn 1.Fahrenheit to Celcius”;
cout<<“n 2.Celcius to FahrenheitnnEnter your choice:”;
cin>>choice;
switch(choice)
{
case 1:
{
cout<<“nEnter temperature in Fahrenheit:”;
cin>>temp;
res=(temp-32)/1.8;
}
break;
case 2:
{
cout<<“nEnter temperature in Celcius:”;
cin>>temp;
res=(temp*1.8)+32;
}
break;
}
cout<<“nConverted Temperature=”<<res;
getch(); //to stop the output screen
}
翻译自: https://www.thecrazyprogrammer.com/2011/03/c-program-for-temperature-conversion.html
摄氏温度转换为华氏温度超时