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

  1. Define temperature in Fahrenheit unit.
  2. Apply in the formula.
  3. 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

Popular posts from this blog

What is ARTIFICIAL INTELLIGENCE?

What is the cloud?

What is Pinterest How to make money from it - Earn money from phone everyday