Advertisement
Spocoman

03. Celsius to Fahrenheit

Sep 1st, 2023 (edited)
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     double celsius;
  7.     cin >> celsius;
  8.  
  9.     double fahrenheit = celsius * 1.800 + 32;
  10.  
  11.     cout.setf(ios::fixed);
  12.     cout.precision(2);
  13.    
  14.     cout << fahrenheit << endl;
  15.  
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement