I am not sure what's going on here, but I have a code sample which is not producing what I expect, here is part in question (just a section):
printf("Now enter a Fahrenheit to convert to Centigrade\n");
fflush(stdout);
scanf("%f",&c);
d = (c-32)*(5/9);
printf("%f\n",c);
printf("Your result in Centigrade is %f\n",d);
The result when I enter 212 for the input is: Your result in Centigrade is 0.000000
When I make a small change:
printf("Now enter a Fahrenheit to convert to Centigrade\n");
fflush(stdout);
scanf("%f",&c);
d = (c-32)*5/9;
printf("%f\n",c);
printf("Your result in Centigrade is %f\n",d);
The result now when I enter 212 for the input is: Your result in Centigrade is 100.00000, which is correct.
In math (a+b) * (c/d) is the same as (a+b) * c / d; so what's going on with the zero result with just the extra parentheses?