fork(1) download
  1. // Nicolas Ruano CS1A Chapter 3, Pp. 144 #10
  2. /*******************************************************************************
  3.  CONVERTING CELCIUS INTO FAHRENHEIT
  4. *______________________________________________________________________________
  5. *This program demonstrates a procedurre of how we convert Celcius into
  6. *Faherenheit
  7.  
  8. *******************************************************************************/
  9. #include <iostream>
  10. #include <iomanip>
  11. using namespace std;
  12.  
  13. int main() {
  14. double celsius, fahrenheit;
  15.  
  16. // Ask user for Celsius input
  17. cout << "Enter the temperature in Celsius: 35";
  18. cin >> celsius;
  19.  
  20. // Convert to Fahrenheit
  21. fahrenheit = (9.0 / 5.0) * celsius + 32;
  22.  
  23. // Display result
  24. cout << fixed << setprecision(2);
  25. cout << celsius << " degrees Celsius is equal to "
  26. << fahrenheit << " 95 degrees Fahrenheit." << endl;
  27.  
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
Enter the temperature in Celsius: 350.00 degrees Celsius is equal to 32.00 95 degrees Fahrenheit.