摄氏温度转换为华氏温度超时
#include<stdio.h> #include<conio.h>
#include <stdio.h> #include <conio.h>
void main() { double temp,ctemp; int ch; clrscr(); //to clear the screen
void main(){double temp,ctemp; 诠释 clrscr(); //以清除屏幕
printf(“Temprature Converrsion Menu”); printf(“nt1.Fahrenheit to Celsius”); printf(“nt2.Celsius to Fahrenheit”); printf(“nEnter your choice(1/2):”); scanf(“%d”,&ch);
printf(“温度转换菜单”); printf(“ nt1。摄氏度到华氏度”); printf(“ nt2。摄氏度到华氏度”); printf(“ n输入您的选择(1/2):”); scanf(“%d”,&ch);
if(ch==1) { printf(“Enter Temperature in Fahrenheit:”); scanf(“%lf”,&temp); ctemp=(temp-32)/1.8; printf(“nTemprature in celcius is %lf”,ctemp); } else if(ch==2) { printf(“Enter Temperature in Celsius:”); scanf(“%lf”,&temp); ctemp=(1.8*temp)+32; printf(“nTemperature in Fahrenheit is %lf”,ctemp); } else printf(“nWrong choice…..!!”); getch(); //to stop the screen }
if(ch == 1){printf(“以华氏温度输入温度:”); scanf(“%lf”,&temp); ctemp =(temp-32)/1.8; printf(“摄氏温度为%lf”,ctemp); } else if(ch == 2){printf(“以摄氏度输入温度:”); scanf(“%lf”,&temp); ctemp =(1.8 * temp)+32; printf(“华氏温度为%lf”,ctemp); } else printf(“ nWrong choice….. !!”); getch(); //停止屏幕}
翻译自: https://www.thecrazyprogrammer.com/2012/05/c-program-to-convert-temperature-from.html
摄氏温度转换为华氏温度超时