以华氏度为单位的城市温度通过键盘输入。现在我需要编写一个程序来将此温度转换为摄氏度。
所以这里是公式:
°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);
}
谁能告诉我出了什么问题?