#include #include #include int main(void){ FILE *fp; char buffer[3]; int temp = 0; fp = fopen("/sys/class/thermal/thermal_zone7/temp", "r"); fgets(buffer, sizeof buffer, (FILE*)fp); fclose(fp); buffer[strcspn(buffer, "\r\n")] = 0; temp = atoi(buffer); printf(" %d°C \n", temp); return 0; }