Celsius temp range (for water) is 100 deg (0 to 100), while Fahrenheit has a 180 deg range (32 to 212). As you can see, Celsius degrees must be larger, to cover the same range, and also start 32 deg less than Fahrenheit..
So to convert C to F you need to adjust the range and remove the 32 degree offset.
So the formula is C= 180/100 -32F, or 9/5-32F.
C = (F - 32.0) / 1.8
F = (C * 1.8) + 32.0
Your formula is wrong.
Assume 98.6 degrees F
c=((9/5)*ftemp)-32
c = (1 * 98.6) - 32 9/5 = 1 because it is assumed an integer by the compiler. You need 9.0/5.0 which = 1.8
c = 98.6 - 32
c = 66.6
C = (F - 32.0) / 1.8
C = (98.6 - 32.0) / 1.8
C = 66.6 / 1.8
C = 37
deg C = ( deg F - 32F) * 5/9
Your formula appears to be deg C = (9/5 * deg F) - 32
change line: ctemp=((9/5)*ftemp)-32;
may be: ctemp=((9.0/5.0)*ftemp)-32.0;
or: ctemp=9.0*ftemp/5.0-32;
#include
int main()
{
double ftemp,ctemp ;
printf("\n entre the value of ftemp \n");
scanf("%lf",&ftemp);
ctemp=((9/5)*ftemp)-32;
printf("\n the value of ctemp is %0.2f \n" ,ctemp);
return (0);
}