fork download
  1. //OrinTill Qimid CS1A Chapter 4, P. 294, 4
  2. //
  3. /**************************************************************
  4.  * Conversion from Fahrenheit to celsius
  5.  *
  6.  * ____________________________________________________________
  7.  * This program will display a table of conversion from 0-20 to celsius
  8.  * ____________________________________________________________
  9.  * INPUT
  10.  * i : the number of conversion
  11.  * OUTPUT
  12.  * C : the converted number
  13.  **************************************************************/
  14. #include <iostream>
  15. #include <iomanip>
  16. #include <cmath>
  17. using namespace std;
  18. float celsius(float F);
  19.  
  20. int main()
  21. {
  22.  
  23.  
  24. for (int i = 0; i <= 20; i++)
  25. {
  26. celsius(i);
  27. }
  28.  
  29.  
  30.  
  31. return 0;
  32. }
  33. float celsius(float F)
  34. {
  35. // C=5/9(F-32)
  36. float C;
  37. C= 5.0/9.0*(F-32.0);
  38. cout<<"your temp in celsius is "<<C<<endl;
  39. return C;
  40. }
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
Standard output is empty