gpt4 book ai didi

c - 编译C代码时出错

转载 作者:太空宇宙 更新时间:2023-11-04 05:05:42 24 4
gpt4 key购买 nike

<分区>

城市的华氏温度是通过键盘输入的。现在我需要编写一个程序将此温度转换为摄氏度。

公式如下:

°C = (°F -  32)  x  5/9

示例输入/输出:

Enter Temperature of Dhaka in Fahreinheit: 98.6
Temperature of Dhaka in Centigrade 37.0 C
Now, i have tried with this, but not works.

代码:

# include <stdio.h>

void main()
{
float C;
printf("Pleas Enter Your Fahreinheit Value to see in centrigate=");
scanf("%d",&C);

printf(C);

float output;
output=(C-32)*(5/9);

printf("The centrigate Value is = %.2lf\n\n" ,output);
}

谁能告诉我哪里出了问题?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com