Exercise temperature conversion 2-4 (5 minutes)

Exercise temperature conversion 2-4 (5 minutes)

This problem requires programming, calculates Fahrenheit Celsius corresponding to 150 ° F. Formula: C * =. 5 (32-F.) /. 9, wherein: C represents temperature in degrees Celsius, F. Fahrenheit represents output data required integer.

Input formats:

This title is not entered.

Output formats:

In the following format output

fahr = 150, celsius = 计算所得摄氏温度的整数值


 

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {

int C,F=150;
C=5*(F-32)/9;
printf("fahr = 150, celsius =%d",C);


return 0;
}

 

 

 



Guess you like

Origin www.cnblogs.com/xxl-h/p/11110701.html