This program assigns an input value to degF then performs a conversion on that value, assigning the result to degC for output. For example, input of 98.6 will output 37C.

C++ Programming in easy steps, 5th Edition

#include <iostream>
using namespace std;

int main()
{
  float degF, degC;
  cout << "Enter Fahrenheit Temperature: ";
  cin >> degF;
  degC = ((degF - 32.0 ) * (5.0 / 9.0));
  cout << degF << "F is " << degC << "C";
  cout << endl;
  return 0;
}