Fahrenheit to celsius c++ – C++ Program to Convert Fahrenheit to Celsius

Fahrenheit to celsius c++: In the previous article, we have discussed C++ Program to Convert Temperature from Celsius to Fahrenheit. In this article, we will see C++ Program to Convert Fahrenheit to Celsius.

C++ Program to Convert Fahrenheit to Celsius

  • Write a C++ program to convert temperature from fahrenheit to celsius degree.

In this C++ program to convert temperature from Fahrenheit to Celsius , we will take temperature in fahrenheit as input from user and convert to Celsius and print it on screen. To convert Fahrenheit to Celsius we will use following conversion expression:

C = (F – 32)*(5/9)
where, F is temperature in fahrenheit and C is temperature in celsius.

Points to Remember

  • Celsius is a temperature scale where 0 °C indicates the melting point of ice and 100 °C indicates the steam point of water.
  • Fahrenheit temperature scale was introduced around 300 years ago and is currently used in USA and some other countries. The boiling point of water is 212 °F and the freezing point of water is 32 °F.

C++ program to convert temperature from Fahrenheit to Celsius

C++ program to convert temperature from Fahrenheit to Celsius

// C++ program to convert temperature from fahrenheit to celcius
 
#include <iostream>
using namespace std;
  
int main() {
    float fahren, celsius;
  
    cout << "Enter the temperature in fahrenheit\n";
    cin >> fahren;
  
    // convert fahreneheit to celsius 
    // Subtract 32, then multiply it by 5, then divide by 9
     
    celsius = 5 * (fahren - 32) / 9;
  
    cout << fahren <<" Fahrenheit is equal to " << celsius <<" Centigrade";
      
    return 0;
}

Output

Enter the temperature in fahrenheit
80
80 Fahrenheit is equal to 26.6667 Centigrade

In above program, we first take fahrenheit temperature as input from user. Then convert it to celsius using above conversion equation and print it in screen.

Do you want to improve extra coding skills in C++ Programming language? Simply go with the C++ Basic Programs and start practicing with short and standard logics of the concepts.