Program to convert Fahrenheit into Celsius in C programming language
Explanation
Fahrenheit and Celsius are the measures of temperature having Unit in degrees as oF
oC respectively. In this tutorial, we have to convert Fahrenheit to Celsius by using the scientific formula in programmes of different languages.
Formula
T(oC) = ((T(oF) - 32 ) × 5)/9
Algorithm
- Define temperature in Fahrenheit unit.
- Apply in the formula.
- Print the temperature in Celsius.
Solution program
#include<stdio.h>
int main() { float fahrenheit, celsius; printf ("Enter temperature in fahrenheit :"); scanf("%f", &fahrenheit); celsius = ((fahrenheit-32)*5)/9; printf("temperature in celsius: %f",celsius); return(0); }
This is it, the output of the program would be,
Enter Fahrenheit:
100
Celsius: 37.777779
Hope this post helped someone, Good Luck!
Comments
Post a Comment