Write program to create function to convert Fahrenheit to Celsius
Create a convert() function that takes one argument: a float value called fahrenheit.
The converted value is returned by the function.
The three-step formula for converting Fahrenheit to Celsius:
#include <iostream> /*from w w w. j a v a2s. c o m*/ float convert(float); int main() { float fahrenheit; float celsius; std::cout << "Please enter the temperature in Fahrenheit: "; std::cin >> fahrenheit; celsius = convert(fahrenheit); std::cout << "\nHere's the temperature in Celsius: "; std::cout << celsius << "\n"; return 0; } // function to convert Fahrenheit to Celsius float convert(float fahrenheit) { float celsius; celsius = ((fahrenheit - 32) * 5) / 9; return celsius; }