Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- static void converttoFahrenheit(double c);
- static void convertoCelsius(double f);
- int main()
- {
- double F, C;
- cout << "Please enter degrees Celcius: ";
- cin >> C;
- converttoFahrenheit(C);
- cout << "Please enter degrees Fahrenheit: ";
- cin >> F;
- convertoCelsius(F);
- system("pause");
- return 0;
- }
- static void converttoFahrenheit(double c) {
- double Fahrenheit = (c * 9 / 5) + 32;
- cout << "The temperature in Fahrenheit is " << Fahrenheit << endl;
- }
- static void convertoCelsius(double f) {
- double Celsius = (f - 32) * 5 / 9;
- cout << "The temperature in Celsius is " << Celsius << endl;
- }
Add Comment
Please, Sign In to add comment