Convert farenheit to celsius - C

Conversion from one unit of temperature to another unit of temperature is kind of program every student need to create in his initial days.
Below is a simple program written in C/C++ which will take as input the temperature in Fahrenheit and will convert it into Celsius.

Convert Farenheit to Celsius

void main()
	float a = 0.0, result = 0.0;
	printf("\n \t \t ==== Program to convert farenheit to celsius ====");
	printf("\n \t \t ====================================================");
	printf("\n \n \t \t Fahreneit : ");
	scanf("%f", &a);
	result = (5 * (a - 32)) / 9;
	printf("\n \t \t Centigrade : %f", result);

Post a Comment