#include<stdio.h>
void Temperatures(double);
const float K = 1.8;
const float A = 32.0;
const float B = 273.16;
int main()
{
double TEM;
int a;
printf("please input the degree Fahrenheit:");
a = scanf("%lf",&TEM);
while(a == 1)
{
Temperatures(TEM);
printf("please input the degree Fahrenheit(q to quit):");
a = scanf("%lf",&TEM);
}
return 0;
}
void Temperatures(double TEM)
{
double celsius,kelvin;
celsius = (TEM-A) / K;
kelvin = celsius + B;
printf("Fahrenheit:%.2lf, Celsius:%.2lf, Kelvin:%.2lf\n",TEM,celsius,kelvin);
}
void Temperatures(double);
const float K = 1.8;
const float A = 32.0;
const float B = 273.16;
int main()
{
double TEM;
int a;
printf("please input the degree Fahrenheit:");
a = scanf("%lf",&TEM);
while(a == 1)
{
Temperatures(TEM);
printf("please input the degree Fahrenheit(q to quit):");
a = scanf("%lf",&TEM);
}
return 0;
}
void Temperatures(double TEM)
{
double celsius,kelvin;
celsius = (TEM-A) / K;
kelvin = celsius + B;
printf("Fahrenheit:%.2lf, Celsius:%.2lf, Kelvin:%.2lf\n",TEM,celsius,kelvin);
}