摄氏温度转换为华氏温度超时_C程序将温度从华氏温度转换为摄氏温度或将摄氏温度转换为华氏温度...

摄氏温度转换为华氏温度超时

#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

摄氏温度转换为华氏温度超时

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值