This is a c program which converts fahrenheit to celsius . When I write number 9 in decimal form float tempFahToCelsius= (tempFah - 32) * (5/9); to float tempFahToCelsius= (tempFah - 32) * (5/9.0);
output of the program is different.
If 5 is the entered value then the output in celsius is -0.000000
but if in the formula 5 or 9 or both are written as decimal then the output for 5 entered value in celsius is -15.
#include <stdio.h>
void main()
{
float tempFah;
printf("Enter value of temperature in fahrenheit\n");
scanf("%f", &tempFah);
float tempFahToCelsius= (tempFah - 32) * (5/9);
printf("%f fahrenheit in celsius is %f\n",tempFah, tempFahToCelsius);
}