Advertisement
medajibka

3.1

Apr 18th, 2022
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5. //double x;
  6. // int a, b, c;
  7.  
  8. //void input() {
  9. //    cout << "Enter x: ";
  10. //    cin >> x;
  11. //    cout << "Enter a: ";
  12. //    cin >> a;
  13. //    cout << "Enter b: ";
  14. //    cin >> b;
  15. //    cout << "Enter c: ";
  16. //    cin >> c;
  17. //}
  18.  
  19. double celsiusToFahrenheit(const double degree) {
  20.     return degree * 1.8 + 32;
  21. }
  22.  
  23. int main() {
  24.  
  25. //    input();
  26.  
  27. //    while (b < a) {
  28. //        cout << "Input range again:\n";
  29. //        input();
  30. //    }
  31.  
  32.     for (double c = 15; c < 30; c++) {
  33.         cout << "Celsius: " << c << " --> Fahrenheit: " << celsiusToFahrenheit(c) << ";\n";
  34.     }
  35.  
  36.     return 0;
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement