C++ Program to Convert from Fahrenheit to Celsius

C++ Program to Convert from Fahrenheit to Celsius

Write C++ Program to Convert from Fahrenheit to Celsius

// CPP Program to Convert from Fahrenheit to Celsius

#include <iostream>

using namespace std;

int main()
{
    float fahr, cel;

    cout << "Enter Fahrenheit :--> ";
   	cin >> fahr;

	cel = (fahr - 32) * 5 / 9;  //formula to convert

    cout << "\nTemperature in Celsius : " << cel;

    return 0;

}

Output:

Enter Fahrenheit :--> 40

Temperature in Celsius : 4.44