Guest User

Untitled

a guest
Jul 17th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <iostream>
  3.  
  4. double getFahrenheit(int celsius);
  5. double getKelvin(int celsius);
  6.  
  7. using namespace std;
  8.  
  9. int main(int argc, char** argv) {
  10. char contin = 'Y';
  11. double celsius;
  12.  
  13. while(toupper(contin) == 'Y') {
  14. cout << endl << "Enter the degree in Celsius: ";
  15. cin >> celsius;
  16. cout << endl << "The degree in Celsius " << celsius;
  17. cout << endl << "The degree in Kelvin: " << getKelvin(celsius);
  18. cout << endl << "The degree in Fahrenheit: " << getFahrenheit(celsius);
  19. cout << endl << endl << "Would you like to continue? (Y/N): ";
  20. cin >> contin;
  21. }
  22.  
  23. return (EXIT_SUCCESS);
  24. }
  25.  
  26. double getFahrenheit(int celsius) {
  27. return (celsius + 273.15);
  28. }
  29.  
  30. double getKelvin(int celsius) {
  31. return ((celsius * 1.8) + 32);
  32. }
Add Comment
Please, Sign In to add comment