Advertisement
Kagalive

F to C

Sep 30th, 2020
1,216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.  
  7.   double fahrenheit{};
  8.   double celsius{};
  9.  
  10.   cout << "Enter temperature (F): ";
  11.   cin >> fahrenheit;
  12.  
  13.   celsius = (fahrenheit - 32.0)*5.0/9.0;
  14.  
  15.   cout << celsius << " degrees C\n";
  16.  
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement