Cnvmendoza

Temperature

Oct 19th, 2021 (edited)
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. main(){
  5.     // Celsius
  6.     double C;
  7.     cout << "Celsius to Fahrenheit Conversion: ";
  8.     cin >> C;
  9.     // Fahrenheit
  10.     double F;
  11.     F = 9 * C / 5 + 32;
  12.     cout << "Temperature: " << std::setprecision(3) << std::fixed << F << " degrees Fahrenheit";
  13. }
Add Comment
Please, Sign In to add comment