A program with a function

// Author: Karl Abrahamson
// Date:   01/12/00
//
// This program reads a temperature in degrees fahrenheit and 
// prints the equivalent temperature in degrees celsius.

#include <iostream>
using namespace std;

///////////////////////////////////////////////////////////
//                   fahrenheitToCelsius
///////////////////////////////////////////////////////////
// fahrenheitToCelsius(fahr) returns the celsius equivalent
// of fahrenheit temperature fahr.
///////////////////////////////////////////////////////////

double fahrenheitToCelsius(double fahr)
{
  return (5.0/9.0) * (fahr - 32.0);
}

///////////////////////////////////////////////////////////
//                   main
///////////////////////////////////////////////////////////

int main()
{
  double f;
  cout << "What temperature shall I convert? ";
  cin >> f;
  cout << "Fahrenheit temperature " << f 
       << " is equivalent to celsius temperature "
       << fahrenheitToCelsius(f) 
       << endl;
  return 0;
}

Notes on the program

// Author: Karl Abrahamson
// Date:   01/12/00
//
// This program reads a temperature in degrees fahrenheit and 
// prints the equivalent temperature in degrees celsius.

#include <iostream>
using namespace std;
You should set off each function so that it is easy to find. Include a contract for each function. Be sure that the contract clearly tells someone how to use the function. Be sure that it mentions the significance of each and every parameter, and of the return value (if any).
///////////////////////////////////////////////////////////
//                   fahrenheitToCelsius
///////////////////////////////////////////////////////////
// fahrenheitToCelsius(fahr) returns the celsius equivalent
// of fahrenheit temperature fahr.
///////////////////////////////////////////////////////////
The function starts with a heading, and then has a body enclosed in braces. To return a value, use a return statement.
double fahrenheitToCelsius(double fahr)
{
  return (5.0/9.0) * (fahr - 32.0);
}
It is not necessary to have a contract for the main program because that contract is at the top of the program, telling what the program as a whole does.
///////////////////////////////////////////////////////////
//                   main
///////////////////////////////////////////////////////////

int main()
{
  double f;
  cout << "What temperature shall I convert? ";
  cin >> f;
  cout << "Fahrenheit temperature " << f 
       << " is equivalent to celsius temperature "
       << fahrenheitToCelsius(f) 
       << endl;
  return 0;
}