| 5 | using namespace std; |
| 6 | |
| 7 | int main() { |
| 8 | float temp; |
| 9 | char unit; |
| 10 | |
| 11 | cout << "Enter the temperature: "; |
| 12 | cin >> temp; |
| 13 | |
| 14 | cout << "Enter the unit (C/F): "; |
| 15 | cin >> unit; |
| 16 | |
| 17 | if (unit == 'C') { |
| 18 | cout << "The temperature in Fahrenheit is " << (temp * 9 / 5) + 32 << "F." << endl; |
| 19 | } else if (unit == 'F') { |
| 20 | cout << "The temperature in Celsius is " << (temp - 32) * 5 / 9 << "C." << endl; |
| 21 | } else { |
| 22 | cout << "Invalid unit." << endl; |
| 23 | } |
| 24 | |
| 25 | return 0; |
| 26 | } |
nothing calls this directly
no outgoing calls
no test coverage detected