// // Author: Brandon Mohawk // Teacher: Dr. Wang // // Due date: 02/06/07 // // Goal: The program will display a table showing centigrade temperatures and their corresponding fahrenheit temperatures. // // Compile: g++ ctof.cpp -o ctof.out // run: ./ctof.out #include #include using namespace std; int main() { system("clear"); cout << " C || F\n"; cout << "------||-----------\n"; for (int i = 1; i <21; i++) { if (i > 9) cout << " " << i << " || " << 9/5.0 * (float(i)) + 32 << endl; else cout << " " << i << " || " << 9/5.0 * (float(i)) + 32 << endl; } return 0; }