Xiang
12-29-2002, 11:34 AM
Dear sir,
I want to convert a temperature reading in fahrenheit degrees to celsius, but my celsius in the end always occur 0 figure. Why???
#include <stdio.h>
main()
{
int f;
float c;
printf("Farenheit: ");
scanf(%d", &f);
c = (5/9)*(f-32);
printf("%d Fahrenheit = %f Celsius \n", f, c);
return 0;
}
Thanks
Xiang
I want to convert a temperature reading in fahrenheit degrees to celsius, but my celsius in the end always occur 0 figure. Why???
#include <stdio.h>
main()
{
int f;
float c;
printf("Farenheit: ");
scanf(%d", &f);
c = (5/9)*(f-32);
printf("%d Fahrenheit = %f Celsius \n", f, c);
return 0;
}
Thanks
Xiang