Công thức
celsius = (fahrenheit - 32) * 5 / 9;
Thuật toán
B1: Khai báo fahrenheit, celsius B2: Nhập fahrenheit B3: Áp dụng công thức B4: In celsius
Chương trình
#include <stdio.h>
int main() {
float fahrenheit, celsius;
printf("Nhap do Fahrenheit: ");
scanf("%f", &fahrenheit);
celsius = (fahrenheit - 32) * 5 / 9;
printf("Do Celsius: %f\n", celsius);
return 0;
}
Kết quả
Nhap do Fahrenheit: 100 Do Celsius: 37.777779