This question requires writing a program to calculate the Fahrenheit temperature corresponding to a temperature of 26°C. Calculation formula:, F=9×C/5+32
where: C
indicates the temperature in Celsius, F
indicates the temperature in Fahrenheit, and the output data is required to be an integer.
Input format:
This question has not been entered.
Output format:
Output in the following format
celsius = 26, fahr = 对应的华氏温度整数值
Code:
# include <stdio.h>
# include <stdlib.h>
int main(){
int celsius = 26,fahr;
fahr = 9 * celsius / 5 + 32;
printf("celsius = %d, fahr = %d",celsius,fahr);
return 0;
}
Submit screenshot:
Precautions:
At the beginning, Pat
the result of multiplying with parentheses on the above was always reported an error, but there Dev++
was no problem when running on the local one . It was a bit magic...