fork download
  1. // Gage Alvarez CS1A Chapter 3 P.187, #4
  2.  
  3. /**************************************************************
  4.  *
  5.  * calculate fahrenheit based on celcius
  6.  * ____________________________________________________________
  7.  * Description
  8.  * This program calculates the fahrenheit based on the tempurature in celcius
  9.  * ____________________________________________________________
  10.  * INPUT
  11.  * celcius: the tempurature in celcius
  12.  *
  13.  * OUTPUT
  14.  * fahrenheit: the tempurature in fahrenheit
  15.  *
  16.  **************************************************************/
  17.  
  18. #include <iostream>
  19. using namespace std;
  20.  
  21. int main() {
  22. float celcius;
  23. float fahrenheit;
  24. cin >> celcius;
  25. fahrenheit = ((5.0/9.0)*celcius) + 32;
  26. cout << fahrenheit;
  27. return 0;
  28. }
Success #stdin #stdout 0.01s 5284KB
stdin
232
stdout
160.889