|
|
|
© 1998 by Bobby Griggs.
// Program name: Temperature
// Purpose: Convert from degrees Fahrenheit to degress Celsius.
// Info: Required program for Chapter 3
#include < iostream.h >
#include < stdio.h >
#include < iomanip.h >
void main()
{
int fahrenheit;
float celsius;
cout << setiosflags(ios::fixed) << setprecision(0);
cout << "Enter a temperature in degrees Fahrenheit ... ";
cin >> fahrenheit;
cout << endl;
celsius = (fahrenheit - 32) * (5.0 / 9.0);
cout << "The conversion is " << celsius << " degrees Celsius." << endl << endl;
cout << "Hit any key to continue ..." << endl;
getchar();
return;
}
|