C++ Program to Convert Celsius to Fahrenheit

C++ Program to Convert Celsius to Fahrenheit

Write C++ Program to Convert Celsius to Fahrenheit

// CPP Program to Convert Celsius to Fahrenheit

#include <iostream>

using namespace std;

int main()
{

    float fahr, cel;

    cout << "Enter Temperature (C) :--> ";
    cin >> cel;

    fahr = (1.8 * cel) + 32.0; //temperature conversion formula
    cout << "\nTemperature in Fahrenheit :--> " << fahr;

    return 0;

}

Output:

Enter Temperature (C) :--> 0

Temperature in Fahrenheit :--> 32.00 F