Program to convert Fahrenheit to Celsius in C++

Write a program to convert Fahrenheit to Celsius in C++.

PROGRAM:

#include <iostream>
using namespace std;

int main()
{
    float celsius;
    float fahrenheit;

    cout << "Enter Fahrenheit temperature: ";
    cin >> fahrenheit;
    celsius = (fahrenheit-32)/1.8;
    cout << "Temperature in Celsius = " << celsius << endl;

    return 0;
}

 

OUTPUT:

convert fahrenheit to celsius in c++

 

To Convert Celsius to Fahrenheit:

Program to convert Celsius to Fahrenheit

Leave a Reply