Guest User

Untitled

a guest
Jan 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. using namespace std;
  2. static void converttoFahrenheit(double c);
  3. static void convertoCelsius(double f);
  4.  
  5. int main()
  6. {
  7.  
  8. double F, C;
  9.  
  10.  
  11. cout << "Please enter degrees Celcius: ";
  12. cin >> C;
  13. converttoFahrenheit(C);
  14.  
  15.  
  16. cout << "Please enter degrees Fahrenheit: ";
  17. cin >> F;
  18. convertoCelsius(F);
  19.  
  20. system("pause");
  21.  
  22. return 0;
  23. }
  24.  
  25. static void converttoFahrenheit(double c) {
  26. double Fahrenheit = (c * 9 / 5) + 32;
  27. cout << "The temperature in Fahrenheit is " << Fahrenheit << endl;
  28. }
  29.  
  30. static void convertoCelsius(double f) {
  31. double Celsius = (f - 32) * 5 / 9;
  32. cout << "The temperature in Celsius is " << Celsius << endl;
  33. }
Add Comment
Please, Sign In to add comment