fork(1) download
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main() {
  6. double celsius, fahrenheit;
  7.  
  8. // Ask the user for the Celsius temperature
  9. cout << "Enter temperature in Celsius: 25";
  10. cin >> celsius;
  11.  
  12. // Convert to Fahrenheit
  13. fahrenheit = (9.0 / 5.0) * celsius + 32;
  14.  
  15. // Display the result with 2 decimal places
  16. cout << fixed << setprecision(2);
  17. cout << celsius << "25.00 Celsius is equal to ";
  18. cout<< fahrenheit << "77.00 Fahrenheit." << endl;
  19.  
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
Enter temperature in Celsius: 250.0025.00 Celsius is equal to 32.0077.00 Fahrenheit.