fork download
  1. //Castulo Jason Quintero CSC5 Chapter 3, P. 83, #13
  2. //
  3. /**************************************************************
  4.  *
  5.  * Compute Celsius to Fahrenheit
  6.  * ____________________________________________________________
  7.  * This program compute Celsius to Fahrenheit.
  8.  *
  9.  * Computation is based on the formula:
  10.  * F = (9.0/5.0) * C + 32
  11.  * ____________________________________________________________
  12.  * INPUT
  13.  * C: Celsius Degrees
  14.  *
  15.  * OUTPUT
  16.  * F: Fahrenheit Degrees
  17.  *
  18.  **************************************************************/
  19. #include <iostream>
  20. using namespace std;
  21. //Variables
  22. int main() {
  23. float C; // INPUT
  24. float F; // OUTPUT
  25. // Input
  26. cout << "What is the temperature in celsius." << endl;
  27. cin >> C;
  28. // Compute
  29. F = (9.0/5.0) * C + 32;
  30. // Output
  31. cout << "The temperature in Fahrenheit is " << F << "." << endl;
  32. return 0;
  33. }
Success #stdin #stdout 0.01s 5300KB
stdin
25
stdout
What is the temperature in celsius.
The temperature in Fahrenheit is 77.